-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Commit #3133 breaks Enums and Structure #3163
Comments
c# code to reproduce
|
Please provide an example of the C# code that produces the incorrect OpenAPI document. The more information we have, the easier you make it for people to fix issues, and do so accurately. |
I was making it, Should I make a full c# app for it or this examlpe is enough? |
I tested it in the Basic Website ( This behaviour and it was working). I need to take a look at these. I will do asap |
Please provide a configuration of your swagger config because I tested it here https://github.com/domaindrivendev/Swashbuckle.AspNetCore/blob/master/test%2FSwashbuckle.AspNetCore.IntegrationTests%2FSwaggerVerifyIntegrationTest.SwaggerEndpoint_ReturnsValidSwaggerJson_Basic_DotNet_6.verified.txt#L668-L726 Which version of aspnetcore you are using also would be nice Also does the representation of the OpenApi affect your tests using Swagger-ui? |
.net 8 |
Thank you very much for the issue!. |
@martincostello can you please trigger release pipeline with that fix for nuget? 7.0.1 maybe? |
@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?
The text was updated successfully, but these errors were encountered: