enum type support
See original GitHub issueIt looks like typescript enum types are not supported yet in rsponse definition i set ConfigModel as type response like this
// model definition
export enum EnvConfig {
PROD,
DEV
}
export class ConfigModel {
@IsString()
@ApiModelProperty()
domain: string;
@IsInt()
@ApiModelProperty()
port: number;
@ApiModelProperty()
env: EnvConfig;
}
// controller
@Post('api')
@ApiResponse({status: 200, type: ConfigModel})
api(@Body() data: ConfigModel): ConfigModel {
return data;
}
in the swagger-ui docs it’s represented as number:
ConfigModel {
domain: string
port: number
env: number
}
it’s not supported or I did something wrong ?
I’m willing to help and do PR with this feature if anyone will point me in right direction
btw: grate job with the nestjs, i think it’s gonna by the best choice for node developers
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Documentation: 15: 8.7. Enumerated Types - PostgreSQL
Enumerated (enum) types are data types that comprise a static, ordered set of values. They are equivalent to the enum types supported in...
Read more >enum — Support for enumerations — Python 3.11.1 ...
EnumType. The type for Enum and its subclasses. Enum. Base class for creating enumerated constants. IntEnum. Base class for creating enumerated constants ...
Read more >MySQL 8.0 Reference Manual :: 11.3.5 The ENUM Type
An ENUM is a string object with a value chosen from a list of permitted values that are enumerated explicitly in the column...
Read more >Enumeration types - C# reference - Microsoft Learn
An enumeration type (or enum type) is a value type defined by a set of named constants of the underlying integral numeric type....
Read more >Enum Types - Java™ Tutorials
Note: All enums implicitly extend java.lang.Enum . Because a class can only extend one parent (see Declaring Classes), the Java language does not...
Read more >
Top Related Medium Post
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 Free
Top 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
PR #53 has been merged. I’ll publish it soon! 🙂
Now we have the plugin running in the compile time, could the plugin help us telling the enum values to Swagger? @fwoelffel