-
-
Notifications
You must be signed in to change notification settings - Fork 7k
[BUG][SWIFT6] generator doesn't respect x-nullable swagger 2.0 property for $ref attributes #21201
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
Comments
Hi @bogdan, do you know if this bug is also present in the Swift 5 generator? Thanks |
Just checked swift5 - no, it is not reproduced. |
Interesting, I was not expecting this, I was expecting for this bug to be present in the swift 5 generator also. If you want to create a PR with the fix, I can help with the review and merge, otherwise, I will try to look at this when I have some, but I'm not sure when |
The solution I found is to not include nullable property in "TokenWithListingEntity": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32"
},
"token": {
"$ref": "#/definitions/TokenEntity"
},
"active_listing": {
"$ref": "#/definitions/ListingEntity",
"x-nullable": true
}
},
"required": [
"id",
"token"
]
}, It is a little bad semantics as not |
Uh oh!
There was an error while loading. Please reload this page.
Bug Report Checklist
Description
x-nullable
is ignored when$ref
is used on an object property by swift6 generatoropenapi-generator version
OpenAPI declaration file content or url
https://gist.github.com/bogdan/f5fbf0f5940d5540b60ca086beef3fea
Steps to reproduce
Open
Source/API/Models/Item.swift
.Actual:
Expected:
Note that it is only reproducable when
x-nullable
and$ref
are used together:The text was updated successfully, but these errors were encountered: