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

Json schema recent change broke the autorest schema generator #3447

Closed
timotheeguerin opened this issue May 24, 2024 · 0 comments · Fixed by #3451
Closed

Json schema recent change broke the autorest schema generator #3447

timotheeguerin opened this issue May 24, 2024 · 0 comments · Fixed by #3451
Assignees
Labels
bug Something isn't working emitter:json-schema
Milestone

Comments

@timotheeguerin
Copy link
Member

@jsonSchema
model AutorestOpenAPISchema {
  definitions?: Record<Schema>;
}

model Schema {
  additionalProperties?: Schema | boolean;
}

comes down to this, where we have circular reference but here they are treated as json pointer and seems like feature parity wasn't done.

Playground Link

@timotheeguerin timotheeguerin added bug Something isn't working emitter:json-schema labels May 24, 2024
@timotheeguerin timotheeguerin modified the milestone: [2024] June May 24, 2024
github-merge-queue bot pushed a commit that referenced this issue May 28, 2024
fix #3447 
Fixed a few issues with circular references in the JSON Schema emitter
and emitter framework:

* The emitter framework wouldn't restore context correctly when directly
emitting a type reference to a type with a circular reference.
* The JSON Schema emitter did not handle circular references involving
non-JSON Schema types.
* The JSON Schema emitter would create an infinite loop when circular
references needed to be put into $defs.

---------

Co-authored-by: Timothee Guerin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working emitter:json-schema
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants