-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Milestone
Description
I have a couple OAS specs in my app. One of them loads a schema from another spec file, using something like this:
components:
specs:
MyFoo:
$ref: '../otherdir/otherspec.yaml#/components/schemas/Foo'I have oapi-codegen configured thus:
package: mythingy
generate:
models: true
client: true
gin-server: true
embedded-spec: true
import-mapping:
"../otherdir/otherspec.yaml": "mymodule/otherthingy"
output: generated.goI added a CI step to verify the committed generated code was up to date, and started noticing random failures. In the failure cases, the schemas from the externally referenced spec were missing.
I was able to reproduce this locally by running a loop:
( set -x ; while go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen -config oapi-codegen.yaml ./openapi.yaml ; do git diff --exit-code || break ; done )This fails within 10 loops at most for me.
This looks a lot like #1055, but that was closed as "using an old version". I'm reproducing this with the latest release (v2.1.0).