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

Re-route schema references

Open mikethecalamity opened this issue 1 year ago • 2 comments

The annotations on my REST resources define the schema references with URLs like this:

    @APIResponse(content = @Content(schema = @Schema(ref = "https://my.company.com/my-schema.json")))

But I need the OpenAPI processor to find the schema from the Java resources instead: resource://my-schema.json.

What's the best way to re-route the the schema refs to the resources using Smallrye OpenAPI 4. It would need to also handle the $ref properties inside the schemas themselves that have URLs. My guess was to utilize OASFilter? Unless there is a better way.

mikethecalamity avatar Dec 03 '24 00:12 mikethecalamity

Hi @mikethecalamity , is your goal to have the remote URLs references in the output but also include the contents of the schema JSON files in the main OpenAPI? Or do you want a single doc result without any references?

MikeEdgar avatar Dec 03 '24 11:12 MikeEdgar

Hi @MikeEdgar, I would like a single doc without references.

mikethecalamity avatar Dec 03 '24 15:12 mikethecalamity