-
Notifications
You must be signed in to change notification settings - Fork 9k
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
[OpenAPI 3.1] Example value is not generated for nested objects that are referenced via allOf #9941
[OpenAPI 3.1] Example value is not generated for nested objects that are referenced via allOf #9941
Comments
Hi @hkosova, Nice to see you here again ;] We're looking into the issue. Thanks for the report. |
I can confirm this is a regression in Swagger Client. This works properly in Swagger UI version 5.15.2 and stops working in 5.16.0. We updated the Swagger Client version from 3.26.8 to 3.27.0 and there were changes to dereferencing: swagger-api/swagger-js#3472, so it looks like the regression was caused by that. |
@glowcloud can you constructor minimal reproducibe fixture with expected result and current result? |
Associated upstream swagger-js issue has been created in swagger-api/swagger-js#3520 |
We're encountering the same issue with our documentation. This is a high priority matter as a significant portion of our documentation is affected. |
We already have an upstream regression remediation in swagger-api/swagger-js#3521 ETA in SwaggerUI during today. |
Upstream fix released in [email protected] |
Addressed for SwaggerUI in #9950 |
Thanks for the quick fix @char0n, @glowcloud! |
Q&A (please complete the following information)
Ref swagger-api/swagger-js#3520
Content & configuration
Example Swagger/OpenAPI definition:
Describe the bug you're encountering
The issue may (or may not) be related to #8374.
On the "Example Value" tab, the
bar
value appears empty object"bar": {}
instead of an actual object generated from its schema"bar": {"a": 123, "b": "hello"}
. This happens for properties that reference their schema usingallOf
+$ref
instead of just$ref
.The property schema on the "Schema" tab appears correctly though, and shows all fields defined in the referenced schema.
The issue exists for OpenAPI 3.1 definitions and does NOT exist for OpenAPI 3.0 and 2.0.
To reproduce...
Steps to reproduce the behavior:
GET /foo
operation and examine the "Example Value".Actual result:
{ "bar": {} }
Expected result:
openapi: 3.1.0
withopenapi: 3.0.0
.=> Now the example value is correct and includes the nested fields.
Screenshots
Additional context or thoughts
Looks like the correctness of the Example Value depends on whether the user expands the operation or schema first? If I first fully expand the schema under "Schemas" at the bottom, then the Example Value inside the operation is generated correctly.
The text was updated successfully, but these errors were encountered: