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
Hey, I'm pretty new to Open API, so there could be things I'm just misunderstanding, but according to this doc here: https://swagger.io/specification/#reference-object the $ref field looks like it can take on multiple forms.
e.g. it could be a "Reference Object":
"$ref": "#/components/schemas/Pet"
a "Relative Schema Document":
"$ref": "Pet.json"
or a combination of both? a "Relative Documents With Embedded Schema":
I'm just now realizing that maybe the problem is that this library only supports yaml specs, and this one is json? I've heard "json is just a subset of yaml", but I've also heard to be very dubious of this claim 😅
Thanks for reporting this, and thank you for the example spec. Although it's unusual for individual schemas to be broken out into separate files like this, it's perfectly allowable, and I failed to handle it correctly. I'm working on a fix, however there are a few issues to deal with along the way.
The first fix is simple: I assumed that all refs would have the # character, which is wrong. In the future we'll use a default path of #/, meaning the root of the document, in case one isn't provided.
After that, it looks like the generator doesn't correctly deal with schemas that are located in separate files. I'm still working on the fix for this.
Hey, I'm pretty new to Open API, so there could be things I'm just misunderstanding, but according to this doc here: https://swagger.io/specification/#reference-object the
$ref
field looks like it can take on multiple forms.e.g. it could be a "Reference Object":
a "Relative Schema Document":
or a combination of both? a "Relative Documents With Embedded Schema":
this code here though: https://github.com/aj-foster/open-api-generator/blob/main/lib/open_api/reader/state.ex#L172 seems to assume that the ref will always contain a
"#"
, so when I run it on this spec it crashes. This is the spec I'm using, just to play around with this and get a feel for this library: https://github.com/SpaceTradersAPI/api-docs/tree/v2.1.0It uses refs of the middle form, i.e. relative paths to files without a
#
in them.The text was updated successfully, but these errors were encountered: