multiple spec files #770
Unanswered
bogdan-dubyk
asked this question in
Q&A
Replies: 1 comment
-
It's been a while since you asked this, but it might be useful to others anyway. I had a similar issue recently, and I solved it by putting output-options:
skip-prune: true in my generator config file. It makes sense once you see the explanation of the option in this part of the README. I assume it's pruning your object because the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hey, first of all I think there is a very big possibility that it's very straightforward to solve my issue, as I'm a noob in GO, but I have a
yaml
spec files (will share below) from which I can generate code with usage of https://openapi-generator.tech/ go library but not able to do so with deepmap.So basically I have such
yaml
files:api.yaml
and
user.yaml
and my generated
config.yaml
is:and when I'm running
oapi-codegen --config config.yaml api.yaml
I'm getting error:error loading swagger spec in api/openapi/specs/api.yaml : error resolving reference "user.yaml#/components/schemas/registerUser": error unmarshaling JSON: failed to unmarshal property "components" (*openapi3.Components): failed to unmarshal property "schemas" (*openapi3.Schemas): failed to unmarshal extension properties: json: cannot unmarshal array into Go value of type map[string]json.RawMessage (["firstName","lastName","email","password","accountType"])
And if I'm changing
$ref: "user.yaml#/components/schemas/registerUser"
into$ref: "user.yaml
inapi.yaml
, it generating server code but withoutregisterUser
model.And identically same yaml specification generating correct code with usage of https://openapi-generator.tech/ . What I'm doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions