You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seems like Flask-Rebar is not checking for "only" option for fields in a model. May be it could check for the use of "only" and when encountered, warn or error that it is currently not supported.
Just to clarify what the problem is, when only is used in a Marshmallow schema for a particular endpoint, Flask-Rebar omits all the other fields in the corresponding model definition in the generated OpenAPI spec, even if other endpoints use the same Marshmallow schema without only or with a different set of only fields.
Note that the bar field is missing for FooSchema in the generated OpenAPI spec.
Also note that this is exhibiting "last one wins" behavior. If you swap the order in which the foo() and the only_baz() endpoints are defined in app.py, you'll get a different result generated for FooSchema in the OpenAPI spec.
@ghuser2021 said he could work around the issue by not using only.
Seems like Flask-Rebar is not checking for "only" option for fields in a model. May be it could check for the use of "only" and when encountered, warn or error that it is currently not supported.
@jab suggested I create this issue.
Following is an example:
@registry.handles(
rule="get_upload_status/<doc_id>",
method="GET",
response_body_schema={
200: Upload(
only=[
"upload_status",
"updated_time",
]
)
},
tags=["General"],
)
The text was updated successfully, but these errors were encountered: