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

root element of external schema ref files cannot be same name as any property of JsonSchema #1337

Open
jimfrederic opened this issue Mar 4, 2021 · 0 comments

Comments

@jimfrederic
Copy link

This may be an odd file structure, but I believe it is legal. The main yaml references a schema in a different file. If the top level element in that file is any property of JsonSchema, (e.g., title, maximum, parent, etc), document parsing fails. I used Title in this example, and basically, instead of adding a schema "Title" to JsonSchema.ExtensionData, it tries to set JsonSchema.Title.

This was first reported in NSwag as RicoSuter/NSwag#3341

Rather than paste files here I have submitted #1336 with a failing test the illustrate the problem. I don't have a good idea how to solve it. It seems like it would require ExtensionDataDeserializationConverter.ReadJson() to understand when it was being invoked in the context of resolving an external $ref, and with objectType == JsonSchema, and having special handling for properties of JSonSchema

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

No branches or pull requests

1 participant