[discussion]: add decorator for setting the description for a schema
See original GitHub issueIs there an existing issue that is already proposing this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe it
OpenAPI allows a description not only for single properties but also for a complete schema. This can be optionally validated via no_schema_description in OpenAPI validator. Currently I see no way to set this description via a decorator.
Describe the solution you’d like
In correspondence with (PR 983)[https://github.com/nestjs/swagger/pull/983], where ApiSchema would be used with property name, this could work with a decorator named ApiSchema and a property named description, e.g.
@ApiSchema({ description: "Describing my schema" })
class MyDto {}
Teachability, documentation, adoption, migration strategy
No response
What is the motivation / use case for changing the behavior?
Richer OpenAPI documentation with descriptions for schemata
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top Results From Across the Web
GraphQL schema decorators
Schema decorators will allow you to do both of these things and more! They enable you to add features to your schemas with...
Read more >Primer on Python Decorators
By definition, a decorator is a function that takes another function and extends the behavior of the latter function without explicitly modifying it....
Read more >JS Decorators for mongoose model from scratch - Medium
Decorator is pretty simple, it just gets target what is class constructor function and it invokes typeMetadaStorage.addSchemaMetadata method ...
Read more >DRF Function Based View custom schema decorator for query ...
and yes i looking through [django-rest-framework] tag on stackoverflow too and yes i open a discussion on DRF google community (but no answers ......
Read more >@index | typegoose
IndexOptions<T>): ClassDecorator. Parameters: Name, Type, Description ... @index is used to set indices on the schema, this decorator acts like ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Use #983 as a base branch and create a PR to that branch
Could the “title” be included as well ?