Skip to content

[TS] Still open, regression in handling enums #4426

Closed

Description

Look like #4199 has been closed too early, I'm trying with the 1.13 preview version of kiota and the latest published dependencies.
This spec:

openapi: 3.0.3
info:
  title: Apicurio Registry API [v3]
  version: 3.0.x
  description: Apicurio Registry.
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
paths:
  "/admin/rules":
    get:
      responses:
        '200':
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/RuleType"
          description: The list of names of the globally configured rules.
      description: 'List global rules'
components:
  schemas:
    RuleType:
      description: ''
      enum:
      - VALIDITY
      - COMPATIBILITY
      - INTEGRITY
      type: string
      example: VALIDITY

produces code that doesn't compile:

export const RulesRequestBuilderRequestsMetadata: RequestsMetadata = {
    get: {
        uriTemplate: RulesRequestBuilderUriTemplate,
        responseBodyContentType: "application/json",
        adapterMethodName: "sendEnum",
        enumObject: RuleType,
    },
};

intuitively, the correct encoding should be enumObject: RuleTypeObject, but I haven't fully checked it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status

      Done ✔️

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions