You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is 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
The use-case I am thinking-of is exposing properties in request DTOs with names independent of the underlying property. Often, naming conventions differ: e.g. DTOs are coded with camel case:
Decorating every propery with @Expose allows the above request to push through:
export class FooDTO {
@Expose({name: 'bar_name'})
string barName: string;
}
however, this transformation isn't picked-up by the swagger module, leading to an incorrecrt api desc.
further massaging the api with @ApiProperty yields a partial relief:
Now, the transform is refected in the api desc. However, in error messages (e.g validation errors), it is the original symbol that gets embedded in the message.
Describe the solution you'd like
Would be good if such a transformation could be achieved with less boilerplate. But primarily, think uses will benefit from a clear documentation of this recipe (perhaps add it to one of the samples?).
Any news on this? An improvement would be nice. Or is there any other way to write a custom transformation for the documentation? I have an Interceptor transforming all responses to snake_case automatically. But the generated documentation has camelCase properties.
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
The use-case I am thinking-of is exposing properties in request DTOs with names independent of the underlying property. Often, naming conventions differ: e.g. DTOs are coded with camel case:
, but the api exposes snake case params:
Decorating every propery with
@Expose
allows the above request to push through:however, this transformation isn't picked-up by the swagger module, leading to an incorrecrt api desc.
further massaging the api with
@ApiProperty
yields a partial relief:Now, the transform is refected in the api desc. However, in error messages (e.g validation errors), it is the original symbol that gets embedded in the message.
Describe the solution you'd like
Would be good if such a transformation could be achieved with less boilerplate. But primarily, think uses will benefit from a clear documentation of this recipe (perhaps add it to one of the samples?).
Teachability, documentation, adoption, migration strategy
n/a
What is the motivation / use case for changing the behavior?
It's a common use-case IMO, so docs would save time.
The text was updated successfully, but these errors were encountered: