orval icon indicating copy to clipboard operation
orval copied to clipboard

Supporting OpenAPI 3.1: resolving relative references

Open mathematikoi opened this issue 1 year ago • 0 comments

What are the steps to reproduce this issue?

  1. run orval with this open api spec https://gist.github.com/mathematikoi/5616f793f3bf3f488a1fb02b4976470e

What happens?

getting error MissingPointerError

⚠️  MissingPointerError: Token "definitions" does not exist.
🛑  Oups... 🍻. Ref not found: #/definitions/sample

What were you expecting to happen?

generating a client

Any logs, error output, etc?

⚠️  MissingPointerError: Token "definitions" does not exist.
🛑  Oups... 🍻. Ref not found: #/definitions/sample

Any other comments?

this behaviour is kinda expected and should be aknowledged (maybe we should have a support list section in the documentation).

OpenAPI 3.1 indeed integrates JSON Schema draft 2020-12 as its schema language and it changes how $ref and $id work. It introduces the concept of a "schema resource", which is a schema object that is identified by an $id. A schema resource establishes a new resolution scope for relative JSON pointers, such as those in $ref properties.

What versions are you using?

orval/6.16.0 linux-x64 node-v20.0.0 Operating System:Package Version:Browser Version:

mathematikoi avatar Jul 10 '23 19:07 mathematikoi