Closed the42 closed 4 months ago
Well, I was a bit terse about the error, mostly because my setup is not that trivial. I nailed the problem futher down, when a schema is transitively $ref ed, it doesn't get included, so
Schema A --> refs Schema B --> refs Schema C
I a call bundle with Schema a as main uri, Schema C is not included.
However, if I change Schema A to
Schema A --> refs Schema B Schema A --> refs Schema C
all is bundled up. So it might be a transitive referencing issue?
Transitive references works in general. I have tests to verify that it does. It's possible that there's a bug in some edge case, but it could also be an error in the schema. There are cases where something could look like a reference, but isn't a reference in that context and so the bundler wouldn't detect it. For example: "const": { "$ref": "./my-schema" }
. I'd look for things like that in your schema. Without more information, that's the best help I can offer. If you can provide a minimal example to reproduce the error, I can be of more help.
I am using a small helper to bundle schemas, at the bottom. Unfortunately the bundled schema doesn't contain one of the to be bundled schemas.
I tried to re-register the schema, which results in an already registered error, so the schema is read. However, when I call bundle, it is not contained.
The schema A has $id: "https://assets.wko.at/schemas/aw/aw_catalogs" and doesn't get included. Schema B has $id:"https://assets.wko.at/schemas/aw/aw" and $refs A as "/schemas/aw/aw_catalogs#/$defs/Niederlassungstyp"
Maybe within B I $ref elements in A of this schema in an erroneous way, which results in this schema not be exported/bundled?