ANZ v10.0.0
Not sure which organization can fix this, so am reporting the issue here.
On the server the following enum is not accurately exported to typescript.
namespace EnumsLibrary
{
public enum SeatType
{
NoSeat = 0, // bitfields
SeatTypeFirst_Seat = 0,
SeatTypeFirst_Student = 1,
LeftHanded = 1,
RightHanded = 2,
Ambidextrous = 3,
NoPreference = 3,
Handicap = 4,
LastSeatType = 4,
DefaultProfile = 5,
Blocked = 6
}
}
After running 'refresh.bat' in \angular\nswag results in:
export enum SeatType {
NoSeat = 0,
SeatTypeFirst_Seat = 1,
SeatTypeFirst_Student = 2,
LeftHanded = 3,
RightHanded = 4,
Ambidextrous = 5,
NoPreference = 6,
}
... in service-proxy.ts
This may be due to the disconnect of identifiers and values in 'https://localhost:44301/swagger/v1/swagger.json'
"SeatType": {
"enum": [
0,
1,
2,
3,
4,
5,
6
],
"type": "integer",
"format": "int32",
"x-enumNames": [
"NoSeat",
"SeatTypeFirst_Seat",
"SeatTypeFirst_Student",
"LeftHanded",
"RightHanded",
"Ambidextrous",
"NoPreference",
"Handicap",
"LastSeatType",
"DefaultProfile",
"Blocked"
]
},
It seems the first 7 values are assigned to the first 7 identifiers.
This was not an issues for ANZ V8.0.0. SeatType was accurately reflected in service-proxy.cs
export enum SeatType {
NoSeat = 0,
SeatTypeFirst_Seat = 0,
SeatTypeFirst_Student = 1,
LeftHanded = 1,
RightHanded = 2,
Ambidextrous = 3,
NoPreference = 3,
Handicap = 4,
LastSeatType = 4,
DefaultProfile = 5,
Blocked = 6,
}
... and in swagger.json
"SeatType": {
"enum": [
0,
0,
1,
1,
2,
3,
3,
4,
4,
5,
6
],
"type": "integer",
"format": "int32",
"x-enumNames": [
"NoSeat",
"SeatTypeFirst_Seat",
"SeatTypeFirst_Student",
"LeftHanded",
"RightHanded",
"Ambidextrous",
"NoPreference",
"Handicap",
"LastSeatType",
"DefaultProfile",
"Blocked"
]
},
10 Answer(s)
-
0
Hi Tim,
This might be related to https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/1636. Could you upgrade your Swashbuckle.AspNetCore package to latest version and see if it fixes this ?
Thanks,
-
0
This problem occurs with the latest Swashbuckle version 5.6.3
-
0
Hi,
Could you try downgrading to a version smaller than 5.4 ? If that works, at least we can understand if it is related to Swashbuckle or not.
-
0
SeatType is correct for ANZ version 8.5.0 Swashbuckle 5.2.1
-
0
Hi @timmackey
So, it seems like this is related to Swashbuckle if you face the same problem with ANZ version 8.5.0 and Swashbuckle > 5.2.1
-
0
Agreed. How will this get resolved?
-
0
Hi @timmackey
Normally, I wouldn't use same value for different enums. If it is not a big problem, I suggest you to refactor it.
-
0
Hi @ismcagdas
It is a big problem. It's a supported feature of the C# language. As the vendor, why wouldn't you fix something that you, or one or your vendors, broke?
-
0
Hi @timmackey
Unfortunately, we don't have controler over
Swashbuckle.AspNetCore
library. Otherwise, we would try to offer you a solution. I'm not sure if it is possible to fix this in AspNet Zero side but we will try. Is it possible for you to downgrade Swashbuckle.AspNetCore package at least until this is fixed ? -
0
Deploying ANZ version 8.1.0. The issue does need to get resolved before I can upgrade beyond ANZ version 8.5.0.