Define custom name in ApiModelProperty
See original GitHub issueI’m submitting a…
[ ] Regression
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
export class FooDto {
@ApiModelProperty()
readonly timeRange: TimeRange;
}
Expected behavior
export class FooDto {
@ApiModelProperty({ name: 'time_range' })
readonly timeRange: TimeRange;
}
What is the motivation / use case for changing the behavior?
We have API style in underscore case, but JS coding style is camel case and we can’t use in DTO classes underscore variables.
Environment
Nest version: 5.3.7
For Tooling issues:
- Node version: v10.15.0
- Platform: Mac
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Why does @ApiModelProperty "name" attribute has no effect?
property in @ApiModelProperty overwrites the variable name phoneNumberDTOList , but that doesn't work :( I use springfox-swagger 2.9.2
Read more >Swagger @ApiParam vs @ApiModelProperty | Baeldung
The @ApiParam annotation helps to specify the name, type, description (value), and example value of the parameter. Moreover, we can specify ...
Read more >ApiModelProperty (swagger-annotations 1.3.5 API)
If the data type is a custom object, set it's name, or nothing. ... Allows a model property to be marked as hidden...
Read more >Guide - 7.10.12.2 Migrating to OpenApi 3.0 and Swagger 2.X ...
@Schema is used not only to define schemas (which are basically entities/data classes ... @APIModelProperty(readOnly = true), @Schema(accessMode=AccessMode.
Read more >Springfox Reference Documentation - GitHub Pages
Currently this only has name and description. ... Import the bean in your xml configuration by defining a bean of the following type....
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
Is there any news about this feature ? I think it’s valid use case with class-transformer
4.0.0 has been published