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

openapi/json-schema - @extension alignment - emit schemas #6077

Open
chrisradek opened this issue Feb 20, 2025 · 1 comment
Open

openapi/json-schema - @extension alignment - emit schemas #6077

chrisradek opened this issue Feb 20, 2025 · 1 comment
Labels
1_0_E2E breaking-change A change that might cause specs or code to break emitter:openapi3 Issues for @typespec/openapi3 emitter feature New feature or request triaged:core
Milestone

Comments

@chrisradek
Copy link
Member

This issue tracks updating the @typespec/openapi @extension decorator to emit passed in Types as Open API schemas, similar to how @typespec/json-schema will emit JSON Schemas for passed in types.

For example:

@OpenAPI.extension("x-foo", { foo: true })
model Foo {}

will generate a schema since { foo: true } is a Type.

Foo:
  type: object
  x-foo:
    type: object
    required:
      - foo
    properties:
      foo:
        type: boolean
        enum:
          - true

This can be considered a breaking change for anyone passing in a model or tuple expression into @OpenAPI.extension. To migrate, users will need to use Value kinds instead.

For example, { foo: true } would be updated to #{ foo: true }.

This should not be completed until after #6076 has been included in a release.

@markcowl markcowl added emitter:openapi3 Issues for @typespec/openapi3 emitter feature New feature or request breaking-change A change that might cause specs or code to break labels Feb 24, 2025
@markcowl markcowl added this to the [2025] April milestone Feb 24, 2025
@markcowl
Copy link
Contributor

est: 5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1_0_E2E breaking-change A change that might cause specs or code to break emitter:openapi3 Issues for @typespec/openapi3 emitter feature New feature or request triaged:core
Projects
None yet
Development

No branches or pull requests

2 participants