Closed schlagi123 closed 4 years ago
This works with the swagger parser but not with the openapi4j parser.
Workaround is to remove parser 'OPENAPI4J'
from the processor config.
I find out, that this issue is fixed in the version 1.0.4 of the openapi4j (https://github.com/openapi4j/openapi4j/issues/131, https://github.com/openapi4j/openapi4j/releases/tag/1.0.4)
In one of the last commits you updated this version already, but you do not release a new version (https://github.com/openapi-processor/openapi-processor-core/commit/1f2dc87b4032a8314709b07c9d7a19972b719499#diff-c197962302397baf3a4cc36463dce5ea)
it still fails with openapi4j 1.0.4. Problem is that parameter $refs are not resolved by the processor.
see also #24 in case you use non schema refs with the openapi4j parser.
@hauner We checked the release 1.0.4 in openapi4j and it claimed to have fixed the issue. We tried it and it still does not work. Then we checked the actual ticket and found the comment from @schlagi123 to this ticket.
How does this repo relate to https://github.com/openapi-processor related to openapi4j? We have a repo that depends on openapi4j ( that now seems archived). Is there a fix for this issue.
There is no relation to openapi4j.
openapi-processor does generate Java code from OpenAPI. It can use different OpenAPI parsers to read the OpenAPI. It supports the swagger parser, my own parser (https://github.com/openapi-processor/openapi-parser) and openapi4j.
To use parameter $refs with openapi4j you have to resolve the $ref in your code.
That's what openapi-processor does: https://github.com/openapi-processor/openapi-processor-base/blob/04924a62093f494813158fb8d82959b61373fa9f/openapi-processor-core-parser-openapi4j/src/main/kotlin/io/openapiprocessor/core/parser/openapi4j/RefResolverNative.kt
With following YAML is valid OpenAPI but the $ref of a parameter not work: