-
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
read_only not working with references. #1137
Labels
Comments
Hey @SimonSikstrom, thanks for the detailed issue report! Your analysis sounds reasonable, and also your proposed solution. Would you be interested in contributing this fix? |
Thanks for the quick response! Sure I could have a look and see if this is something I could solve in a reasonable timeframe. I'll link upcoming PR if I have something ready. |
same-id
added a commit
to same-id/grpc-gateway
that referenced
this issue
Dec 15, 2022
As described here: grpc-ecosystem#1137
same-id
added a commit
to same-id/grpc-gateway
that referenced
this issue
Dec 20, 2022
As described here: grpc-ecosystem#1137 This partially reverts the recent commit: a0fe8d7 Which doesn't solve the problem for read_only being set on the field. This feature will require setting the "use_allof_for_refs" to true since this breaks existing compatibility with swagger-codegen generated files from the AllOf'd schema - type is now "object" and not $ref. Test added + ReDoc now works with read_only message/enum fields.
same-id
added a commit
to same-id/grpc-gateway
that referenced
this issue
Dec 21, 2022
As described here: grpc-ecosystem#1137 This partially reverts the recent commit: a0fe8d7 Which doesn't solve the problem for read_only being set on the field. This feature will require setting the "use_allof_for_refs" to true since this breaks existing compatibility with swagger-codegen generated files from the AllOf'd schema - type is now "object" and not $ref. Test added + ReDoc now works with read_only message/enum fields.
same-id
added a commit
to same-id/grpc-gateway
that referenced
this issue
Dec 21, 2022
As described here: grpc-ecosystem#1137 This partially reverts the recent commit: a0fe8d7 Which doesn't solve the problem for read_only being set on the field. This feature will require setting the "use_allof_for_refs" to true since this breaks existing compatibility with swagger-codegen generated files from the AllOf'd schema - type is now "object" and not $ref. Test added + ReDoc now works with read_only message/enum fields.
johanbrandhorst
pushed a commit
that referenced
this issue
Dec 21, 2022
As described here: #1137 This partially reverts the recent commit: a0fe8d7 Which doesn't solve the problem for read_only being set on the field. This feature will require setting the "use_allof_for_refs" to true since this breaks existing compatibility with swagger-codegen generated files from the AllOf'd schema - type is now "object" and not $ref. Test added + ReDoc now works with read_only message/enum fields.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So I want to be able to define messages in other messages as
read_only
fields when generating openapi doc, however, that does not seem possible at the moment.Given example:
It will output something like this:
The
readOnly
field is set correctly but according to swagger docs:So its not reading and listing this property as read only in the end.
It seems like common practice is to instead of directly using
$ref
is to useallOf
of the$ref
instead, then the readOnly property would be used.So this
Should in that case become this:
Thoughts?
The text was updated successfully, but these errors were encountered: