Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
andreaTP opened this issue Apr 1, 2024 · 0 comments · Fixed by #4427
Closed

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

andreaTP opened this issue Apr 1, 2024 · 0 comments · Fixed by #4427
Milestone

Comments

@andreaTP
Copy link
Contributor

andreaTP commented Apr 1, 2024

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
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants