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

Unable to include JsonExtensionData in swagger.json file #1382

Closed
MarijnCatthoor opened this issue Jun 14, 2018 · 2 comments
Closed

Unable to include JsonExtensionData in swagger.json file #1382

MarijnCatthoor opened this issue Jun 14, 2018 · 2 comments

Comments

@MarijnCatthoor
Copy link

I have a model that has a property that is decorated with the JsonExtensionData attribute:
image
However, when generating the swagger.json file, this isn't added as additionalproperties:
image

I use following code to enable NSwag in my web API:
image

The Web API is an .Net core 2.0 web API.

Any idea on how I can force the creation of the AdditionalProperties property and why this is isn't generated out of the box?

Thanks in advance!

@RicoSuter
Copy link
Owner

This needs to be added here: https://github.com/RSuter/NJsonSchema/blob/master/src/NJsonSchema/Generation/JsonSchemaGenerator.cs#L320

=> Check whether a property with JsonExtensionDataAttribute exists and if so, generate the correct schema...

Also the code generators need to correctly process objects with an additionalProperties schema (i.e. generate the same property with the attribute, not sure whether this is already implemented).

@RicoSuter
Copy link
Owner

Now handled by schema generator and was already handled by C# generator (idk how it looks in the TS gen).

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

No branches or pull requests

2 participants