You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
... and a model in openapi.yaml has a reference to a model in local-types.yaml, and in turn, that model is an alias to a model found in a classpath resource, then the reference is not resolved.
The parser attempts to find resolve the reference to /shared-types.yaml by prepending the path of the local types directory, so it looks for types/shared-types.yaml and does not find it. This leave the reference unresolved.
Since the parser is unable to resolve the references, this affects downstream code generation, which creates invalid types for some properties.
if a project is configured as follows ...
... and a model in
openapi.yaml
has a reference to a model inlocal-types.yaml
, and in turn, that model is an alias to a model found in a classpath resource, then the reference is not resolved.Example
openapi.yaml (root contract)
local-types.yaml (exists in
types
folder sibling to root contract)shared-types.yaml (this is in shared-types.yaml resource in the classpath, not in file system)
The parser attempts to find resolve the reference to
/shared-types.yaml
by prepending the path of the local types directory, so it looks fortypes/shared-types.yaml
and does not find it. This leave the reference unresolved.Since the parser is unable to resolve the references, this affects downstream code generation, which creates invalid types for some properties.
A project with a unit test demonstrating the issue is here - https://github.com/douglasbgray/cp-example
This is first observed in version 2.0.24 and still exists in the most recent version 2.1.12.
Here is a PR with a fix and corresponding test - #1892
The text was updated successfully, but these errors were encountered: