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

[Bug]: An incorrect example was generated with the OpenAPI emitter when using @encodedName with @example. #4540

Closed
4 tasks done
akishichinibu opened this issue Sep 26, 2024 · 0 comments · Fixed by #4551
Closed
4 tasks done
Assignees
Labels
bug Something isn't working needs-area

Comments

@akishichinibu
Copy link

Describe the bug

openapi: 3.0.0
info:
  title: (title)
  version: 0.0.0
tags: []
paths: {}
components:
  schemas:
    A:
      type: object
      required:
        - x1
      properties:
        x1:
          type: integer
          format: int32
      example:
        X1: 1

The example in the generated specification doesn't match the schema, causing the specification to fail the linter check.
Expected to be

example:
  x1: 1

Reproduction

https://typespec.io/playground?c=QGV4YW1wbGUoI3sKICBYMTogMQp9KQptb2RlbCBBIMQVQGVuY29kZWROYW1lKCJhcHBsaWNhdGlvbi9qc29uIiwgIngxIinHPmludDMyCn0K&e=%40typespec%2Fopenapi3&options=%7B%7D

Checklist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-area
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants