Describe the bug
When feeding a schema with a subschema with an $id
field, and then referencing that subschema by its full or relative id, datamodel-codegen tries to download said subschema from the internet, resulting in a httpx.ConnectError: [Errno -2] Name or service not known
.
To Reproduce
Example schema:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "https://schemas.example.org/child",
"$defs": {
"child": {
"$id": "https://schemas.example.org/child",
"type": "string"
}
}
}
Used commandline:
$ cat example.json | datamodel-codegen
Expected behavior
No exception is to be thrown.
Version:
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too