-
Notifications
You must be signed in to change notification settings - Fork 243
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
updates openapi @extension
to support value types, and removes starts with x-
extension name constraint
#6078
base: main
Are you sure you want to change the base?
updates openapi @extension
to support value types, and removes starts with x-
extension name constraint
#6078
Conversation
…ts with `x-` extension name constraint
All changed packages have been documented.
Show changes
|
You can try these changes here
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this will need quite the patch in the spec repos
Yes - I'll hold off on merging until the typespec-azure/azure specs PRs are ready/approved. |
Resolves #6076
This PR makes a few changes to the
@typespec/openapi
@extension
decorator to align it closer to the@typespec/json-schema
@extension
decorator.@extension
is updated in 3 ways:x-
prefix is no longer required for the extension name.typeof "foo"
, model expressions, tuple types) retains current behavior but also triggers a deprecation warning.What's with the deprecation warning?
Prior to this PR, passed in types would be converted to JSON values (or emit an error if they couldn't be converted).
So the following TypeSpec
would emit the following OpenAPI:
However, in a follow-up release, passing in the type
{ foo: true }
will cause an OpenAPI schema to be emitted instead:To get back to the current behavior,
#{ foo: true }
should be passed instead.The deprecation warning gives users at least 1 release to be aware of the change and update their code accordingly.
Follow-ups
@OpenAPI.extension
usage to use value kinds Azure/typespec-azure#2236