-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Missing array type when using @ArraySchema #4641
Comments
Hi @paulrutter Are you still experiencing this issue ? I tried to reproduce with core 2.2.22 version and it looks like type shows up in specification. For now I am gonna close this ticket, if issue still appears for you, feel free to reopen "content" : {
"application/json" : {
"schema" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/BulkResulBean"
}
},
"examples" : {
"Example bulk response" : {
"description" : "Example bulk response",
"value" : "description...."
}
}
}
}
|
I will check it out @micryc and reopen if needed. |
I'm seeing this behaviour with 2.2.22 here: It's not clear to me yet whether it's a spring or swagger issue |
This looks to be the cause because a JsonSchema is created without a type: |
@micryc we should reopen, as it apperantly is not fixed (in all cases at least) |
Changing line 510 in modles/swagger-core/src/main/java/io/swagger/v3/core/util/AnnotationsUtils.java from
to
appears to fix the issue. |
Can you create a pr for it @owen4gh? |
Created #4700 |
@owen4gh @paulrutter Thank you a lot for reporting this bug and provided fixes, changes merged and I am closing the issue. |
@micryc When will this be part of a release? |
Hi @paulrutter this fix is a part of the newest Core 2.2.23 release |
@micryc i don't see it on https://mvnrepository.com/artifact/io.swagger.core.v3/swagger-core yet, is it behind? |
@paulrutter Maven repository is usually delayed, check it here: https://central.sonatype.com/artifact/io.swagger.core.v3/swagger-core |
Since we upgraded from 2.2.11 to 2.2.21, the output when using
@ArraySchema
is no longer correct.We're outputting 3.1 via
openAPI31: true
.The output in JSON misses
"type": "array"
.See example on https://github.com/swagger-api/swagger-core/wiki/Swagger-2.X---Annotations#arrayschema
Relevant annotations used:
Left is with 2.2.11, right with 2.2.21.
I see several mentions of fixes in array schema in the changelog, but i doubt this output is now correct.
The text was updated successfully, but these errors were encountered: