-
Notifications
You must be signed in to change notification settings - Fork 6k
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
readOnly on nested objects #6537
Comments
@joerghaubrichs instead of defining |
@wing328 Yes, unfortunately. Actually my original problem was using a reference, so I tried to use an object instead to narrow it down and simplify it, but same issue there. |
😞 I'll see if I can hunt down the bug this weekend... |
It's due to JSON parsing to Swagger model. It doesn't parse 'readOnly' property for references, inline objects, maps and arrays. Here is a PR swagger-api/swagger-core#2502 @wing328 Please review and if possible release in 1.5.x branch. |
@wing328 Is there any date scheduled when new version of 1.5 branch of swagger-core will be released with swagger-api/swagger-core#2502 ? |
@NikolaySl swagger-api/swagger-core#2502 has been merged into swagger-core. We'll need to wait for the next release (1.5.18) |
@wing328 This is still showing on 2.3.1 of swagger-gen. Looks like 1.5.20 of swagger-core is being used. |
still showing in online swagger hub editor |
I'm facing this issue now -- I'll give the workarounds a try, but also wanted to see if there are any thoughts on root cause on this since it's been open for some time. |
Swagger codegen does not currently allow object attributes to be readOnly directly. To do this we need to have the object definition be in a reference [1]. This will have the effect of changing the generated entity types, but it will also fix a bug where `presignedPost` was included in the writable form of `PresignedPostRequest` Issue #1012 WritablePresignedPostRequest improperly requiring readonly property [1] swagger-api/swagger-codegen#6537
Swagger codegen does not currently allow object attributes to be readOnly directly. To do this we need to have the object definition be in a reference [1]. This will have the effect of changing the generated entity types, but it will also fix a bug where `presignedPost` was included in the writable form of `PresignedPostRequest` Issue #1012 WritablePresignedPostRequest improperly requiring readonly property [1] swagger-api/swagger-codegen#6537
Swagger codegen does not currently allow object attributes to be readOnly directly. To do this we need to have the object definition be in a reference [1]. This will have the effect of changing the generated entity types, but it will also fix a bug where `presignedPost` was included in the writable form of `PresignedPostRequest` Issue #1012 WritablePresignedPostRequest improperly requiring readonly property [1] swagger-api/swagger-codegen#6537
Description
Apparently the readOnly property is ignored for definitions of type object. In my example, SomeDefinition has a property someSubObject, which is an object and should be readOnly. So I would expect someSubObject to be in the list of readOnlyVars for SomeDefinition, but instead I find it in the readWriteVars list.
The other readOnly property, someString, is correctly listed in readOnlyVars and not in readWriteVars.
Is there something wrong with the definition, or is this a bug?
Swagger-codegen version
2.2.3
Swagger declaration file content or url
The text was updated successfully, but these errors were encountered: