APIDevTools / json-schema-ref-parser

Parse, Resolve, and Dereference JSON Schema $ref pointers in Node and browsers
https://apitools.dev/json-schema-ref-parser
MIT License
942 stars 226 forks source link

fix: External refs with overrides #317

Closed simonbothen-radinn closed 11 months ago

simonbothen-radinn commented 1 year ago

The external resolver did not take into account for overrides. E.g take the following example:

$ref: 'base.yaml'
id: my_id
settings:
  $ref: 'base_settings.yaml'
  useCache: true

This failed to resolve on $ref: 'base_settings.yaml'. This is due to to root object passes $Ref.isExternal$Ref(obj) and therefore not considering the other child objects. We should still crawl the tree even though the root has a $ref.

jonluca commented 11 months ago

Included in https://github.com/APIDevTools/json-schema-ref-parser/pull/321