question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Define custom name in ApiModelProperty

See original GitHub issue

I’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;
}
image

Expected behavior

export class FooDto {
  @ApiModelProperty({ name: 'time_range' })
  readonly timeRange: TimeRange;
}
image

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:closed
  • Created 5 years ago
  • Reactions:9
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
abouroubicommented, Jun 29, 2019

Is there any news about this feature ? I think it’s valid use case with class-transformer

1reaction
kamilmysliwieccommented, Dec 3, 2019

4.0.0 has been published

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found