jsonschema2md
jsonschema2md copied to clipboard
Dereference schemas
I encountered an issue when I used my custom metaschema that uses the "allOf" keyword to extend the base JSON Schema draft.
{
"$schema": "http://json-schema.org/schema",
"$id": "https://schemas.tf/json/metaschema/1-0-0",
"title": "Core schema meta-schema",
"allOf": [
{
"properties": {
"tfs_custom_prop": {
"type": "boolean",
"default": false
},
// more custom keywords
}
},
{
"$ref": "http://json-schema.org/draft/2019-09/schema#"
}
]
}
However, jsonschema2md fails to handle the external reference to http://json-schema.org/draft/2019-09/schema# and throws an error
[ERROR] { Error: can't resolve reference http://json-schema.org/draft/2019-09/schema# from id https://schemas.tf/json/metaschema/1-0-0#
(No stack trace)
I can work around this by dereferencing my metaschema before using it with jsonschema2md but it would be ideal if jsonschema2md had an option to enable deferencing.
Would you accept a PR for this enhancement?
I definitely would! This has been on my mental wishlist for a long time, I just always found workarounds ;)