Skip to content

[Bug]: Commit #3133 breaks Enums and Structure #3163

@ymg2006

Description

@ymg2006

@jgarciadelanoceda I am writing because this commit removed enums from FromForm.
Here is simple example from v6.9.0 and 7.0.0 output:
v7.0.0: "multipart/form-data": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/TransactionTypeEnum"
},
{
"required": [
"FiscalYearId"
],
"type": "object",
"properties": {
"FiscalYearId": {
"type": "integer",
"format": "int64"
},
"Id": {
"type": "integer",
"format": "int64"
}
}
}
]
}
}
v6.9.0: "multipart/form-data": {
"schema": {
"required": [
"FiscalYearId",
"Type"
],
"type": "object",
"properties": {
"Type": {
"$ref": "#/components/schemas/TransactionTypeEnum"
},
"FiscalYearId": {
"type": "integer",
"format": "int64"
}
}
}
}
This makes nswag to remove Type enum from output api.
createOrEdit(type?: TransactionTypeEnum | undefined, fiscalYearId: number): Observable;
createOrEdit(fiscalYearId: number): Observable;
I don't understand why Enum should be removed from required and moved to allOf, isn't it a type? can't enums be passed optional?
@martincostello why the contribution is not separated in multiple pullrequests?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions