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

typespec-autorest - @Openapi.extension emit schema for Types #2306

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

chrisradek
Copy link
Member

Depends on microsoft/typespec#6229
Fixes microsoft/typespec#6077

This PR updates @azure-tools/typespec-autorest to support emitting schemas for Types passed into the @OpenAPI.extension decorator.

@chrisradek chrisradek changed the title Openapi extension emit schema typespec-autorest - @Openapi.extension emit schema for Types Mar 4, 2025
@azure-sdk
Copy link
Collaborator

azure-sdk commented Mar 4, 2025

All changed packages have been documented.

  • @azure-tools/typespec-autorest
Show changes

@azure-tools/typespec-autorest - breaking ✏️

Updates the @extension behavior to emit schemas for passed in Types. Values will continue to be emitted as raw data. Model and Tuple expressions that were previously treated as Values are now treated as Types.,> ,> Now the following TypeSpec:,> tsp,> @OpenAPI.extension("x-value", "custom value"),> @OpenAPI.extension("x-schema", typeof "custom value"),> model Foo {},> ,> emits the following schema:,> yaml,> Foo:,> type: object,> x-value: custom value,> x-schema:,> type: string,> enum:,> - custom value,>

@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website

@chrisradek chrisradek marked this pull request as ready for review March 4, 2025 20:48
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a tiny bit worried about this change for the value it brings. Wondering if we might be better to just cut of the type conversion for 1.0 so at least using a type is exposed as broken with teh codefix to the user and maybe we add the feature parity in a few month.

Here I am worried that a lot of 3p customers might not pulled the last version and this would be a bigger break(quite confusing I assume as well) with no codefix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

openapi/json-schema - @extension alignment - emit schemas
3 participants