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

Custom swagger provider #260

Closed
SebastianStehle opened this issue Aug 29, 2016 · 3 comments
Closed

Custom swagger provider #260

SebastianStehle opened this issue Aug 29, 2016 · 3 comments

Comments

@SebastianStehle
Copy link
Contributor

Hi,

I have some normal services, but also a controller with dynamic models, that are created from metadata at runtime. I would like to create a swagger specification for this controller, but I am a little bit lost. Which is the main try point, is there an interface I have to implement?

@RicoSuter
Copy link
Owner

A Swagger spec describes a model with a fixed structure (also see JSON Schema). If the schema is dynamic, you cannot describe it with Swagger / JSON Schema... Can you provide a sample or describe your scenario a little bit more in detail?

@RicoSuter
Copy link
Owner

You can provide a custom operation or document processor to generate custom schemas for an operation or the document: https://github.com/NSwag/NSwag/wiki/OwinMiddleware#enable-oauth2-authorization

@RicoSuter
Copy link
Owner

You can change the type with the [JsonSchemaType(typeof(Person))] attribute...

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