Open mitrenegade opened 5 years ago
Hi @mitrenegade. File references are currently unsupported in SwagGen. There are no immediate plans to support them, but PR's are welcome
thanks for the info. i'm open to looking into it if i have time but i guess not right now. can you give any hint why #ref might parse correctly?
"#ref": "./pet.json"
},
doesn't seem to be correct syntax but doesn't result in any errors when generating the client.
#ref
wouldn’t be parsed at all so you’d just end up with an empty Pet Schema definition
I ran into the same issue and would like to ask if you @mitrenegade started to work on it?
No longer working on this
I am trying to use SwagGen to generate client code from an OpenAPI 3.0 spec. The sample spec is https://github.com/yonaskolb/SwagGen/blob/master/Specs/Petstore/spec.yml (translated to json) and works fine when invoked with:
swaggen generate spec.json
I want to replace the components/schemas section with an external schema representing Pet:
with
where pet.json is in the same directory and looks like:
This gives me an error
Fatal error: Reference ./pet.json is unresolved: file /private/tmp/swaggen-20190424-43085-jvmk5p/SwagGen-4.1.0/Sources/Swagger/Component/Reference.swift, line 10 Illegal instruction: 4
For some reason, when I use a #ref instead:
generation succeeds. But, the generated Pet model is empty:
I'm trying to understand why $ref results in an unresolved issue, why #ref kind of works, but results in an incorrect Pet model.