karenetheridge / OpenAPI-Modern

Validate HTTP requests and responses against an OpenAPI v3.1 document
https://metacpan.org/release/OpenAPI-Modern/
Other
5 stars 3 forks source link

feature: public method to resolve references #57

Closed karenetheridge closed 11 months ago

karenetheridge commented 1 year ago

This might belong on JSM or JSMD rather than here.

I am looking at a document and I see a $ref, and want to get the location and/or data of that reference (perhaps doing another hop if the $ref leads to another $ref). doing a document_get is insufficient because the ref needs to be url-decoded and it's possibly relative to the current location, or in another document entirely.

This is what OM::_resolve_ref does, although this takes advantage of internal things like $state - so instead of erroring, we should just die.

karenetheridge commented 11 months ago

This now exists as recursive_get.