-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed as not planned
Closed as not planned
Copy link
Labels
Description
I have two openapi docs. One references a model in the other one. I have configured oapi-codegen as follows:
package: packageB
generate:
models: true
embedded-spec: true
output-options:
skip-prune: true
import-mapping:
./specA.yml: github.com/org/packageA/
output: pkg/api/packageB/v1/types.gen.go
compatibility:
old-aliasing: true
old-merge-schemas: true
disable-flatten-additional-properties: true
The openapi spec for packageB contains a reference such as:
$ref: './specA.yml#/components/schemas/Entity'
The server, client code and the types are generated without an issue.
However, if I try and load the embedded swagger spec:
swagger, err := packageB.GetSwagger()
it throws an error such as:
failed to resolve "Entity" in fragment in URI: "#/components/schemas/Entity": map key "Entity" not found
It seems that the external reference to the other apidoc is lost in the embedded spec.
Is this by design? Is there a configuration setting perhaps I am missing?
margoo0o