smallrye-open-api icon indicating copy to clipboard operation
smallrye-open-api copied to clipboard

No public API to parse existing schema into OpenAPI model

Open matus-m opened this issue 9 months ago • 3 comments

With OpenAPIParser being deprecated (#1762) , there is currently no way to read/parse existing schema into OpenAPI model. Am I missing something or what would be the recommended approach to achieve this?

matus-m avatar Apr 02 '25 09:04 matus-m

Hi @matus-m , what is the use case for separately parsing a stand-alone schema? Do you have it in its own file and you want to add it to the OpenAPI from a filter, for example? There is a property that can be used to insert a schema to the components/schemas, so I'm trying to determine if that might help you.

MikeEdgar avatar Apr 02 '25 13:04 MikeEdgar

Thanks for quick reply @MikeEdgar . One use case would be testing - asserting that the schema generated at runtime has all the attributes we expect (for example if there are a bunch of OASfilters that modify it dynamically). We used to do plain json deserialization into Smallrye model impl classes, but that approach no longer works (after the refactoring where they have been essentially hidden from app developers or marked as deprecated)

matus-m avatar Apr 02 '25 15:04 matus-m

Thanks for the information. We will be sure to not change the availability of OpenApiParser#parseSchema until there is a suitable replacement, and keep this issue open until then as well.

MikeEdgar avatar Apr 02 '25 17:04 MikeEdgar