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

validating openapi document on controller generation (or client) #4235

Open
shlomo-margalit opened this issue Nov 18, 2022 · 1 comment
Open

Comments

@shlomo-margalit
Copy link

I am using operation.ExtensionData in the Controller.liquid template to generate some extra code.
(see #1436 for more details).

if an openapi operation contains the same extension twice, nswag will just set the value to the last entry.

for example when the document contains:
/action
get:
x-property: a
x-property: b

the liquid file will get the property value as "b".

when using https://editor.swagger.io/ to edit the file, it flags the duplicate as error.
but nswag doesn't throw an exception on this.

while debugging nswag I noticed that YamlDotNet already returns just the last entry, without doing any validations.
i'm not sure if this is valid in Yaml or not (maybe it's just invalid in openapi).

is there a plan to validate the openapi document?
if not, I will have to find another tool to do this.

@shlomo-margalit
Copy link
Author

I found the same issue in the YamlDotNet repository:
aaubry/YamlDotNet#536

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