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

[FromForm] attributed model is not showed in swagger.json.components.schemas #1724

Closed
Moskvinr opened this issue Jun 25, 2020 · 4 comments
Closed

Comments

@Moskvinr
Copy link

Moskvinr commented Jun 25, 2020

I need to read properties from components.schemas, but [FromForm]FormExample form is not recognized and not showed in schema.
V 5.5.0

@domaindrivendev
Copy link
Owner

Form schema's are defined inline (as opposed to being a reference to shared schema in components.schemas) and are therefore never written to components.schema.

@max-arshinov
Copy link

@domaindrivendev we also noticed that Document Filters are ignored for schemas that are defined inline. Is there a way to modify inline schemas?

@max-arshinov
Copy link

@domaindrivendev any updates?

@domaindrivendev
Copy link
Owner

Due to the way in which form fields are surfaced by ApiExplorer (the API metadata layer that ships with ASP.NET Core), form Schema's need to be treated as a special case in Swashbuckle, and are generated in a slightly different way to to regular payload schemas.

As a result, they are a) always generated inline within the relevent Operation definition rather components.schemas and b) never passed through the schema filters.

If you need to inspect those schemas, look in the relevent Operation definition instead. If you need to modify, use an IOperationFilter instead of an ISchemaFilter.

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

3 participants