Closed edge33 closed 4 months ago
Cant you just recursively iterate over the properties and remove $id? It is valid JSON schema to include it so I dont think it's the responsibility of this library to provide that option
We had already solved it on our side, as you can see from the linked issue, we just thought it may make sense to include the feature directly in the library, so we took the time to create the issue.
when using
$RefParser.dereference
resolved referenced objects have the $id property as per the resolved schema, this can cause $id clashes using the schemas with other tools relying on multiple schemas, as per: https://github.com/nearform/openapi-transformer-toolkit/issues/179would you consider the possibility to add an option to
dereference()
in order to prevent adding$id
to the resolved schemas?as an example of usage:
consider the following schemas
The dereferenced Post schema would be:
with a configuration flag like
dereference({removeResolvedIds:false})
the output schema in the example would not have the"$id": "User.json"
in theauthor
property