External references don't work
ruckc opened this issue · comments
What version of ogen are you using?
1.0.0
Can this issue be reproduced with the latest version?
Yes
What did you do?
I have an openapi.yaml with a reference to another file.
What did you expect to see?
I expected the $ref
to resolve the reference to the external file.
What did you see instead?
- openapi.yaml:104:13 -> $ref: resolve "./type.json": get "file:///home/user/project/type.json": external references are disabled
What I did after getting the error...
I grepped the ogen source, found the error being raised in openapi/parser/settings.go
from the NoExternal ExternalResolver implementation.
I can not figure out how to pass that in to ogen
. I tried a config.yaml that looked like the below, based on the example configs and the exampes showing infer_types
and depth_limit
.
It would be nice if it was documented how to set the external resoler.
parser:
external: true
Here's full config example.
allow_remote
is what you need.
ogen/examples/_config/example_all.yml
Lines 1 to 8 in d44add5
ok... that would be a naming inconsistency... I saw allow_remote, but it didn't align to anything in settings.go... and the description (enables remote references) doesn't describe the error (external references are disabled)