swagger-api / swagger-core

Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API
http://swagger.io
Apache License 2.0
7.36k stars 2.17k forks source link

OpenAPI 3.1 broken reference to child class with oneOf reference #4634

Closed GooDer closed 1 month ago

GooDer commented 3 months ago

Hi, I encountered another bug related to new OpenAPI 3.1 version.

When we have some object which's attribute is another object which is abstract and has at lease one implementation class it will not be rendered and error is displayed in swagger UI.

Version 3.0 output: image

Version 3.1 output: image

I found out that it is caused again by change in element class from ComposedSchema to JsonSchema.

I will try to provide fix also tomorrow.

Minimalistic project to reproduce: swagger-core-bug.zip

micryc commented 1 month ago

Thank you @GooDer for reporting issue and providing fix PR. Closing ticket.