Hey! I love this package, and I've been playing around with it to validate JSONs and schemas.
However, I can't seem to use relative paths in refs.
|
/// Prepends inherited Uri data to the ref if necessary. |
|
Uri _translateLocalRefToFullUri(Uri ref) { |
|
// TODO: add a more advanced check to find out if the $ref is local. |
|
// Does it have a fragment? Append the base and check if it exists in the _refMap |
|
// Does it have a path? Append the base and check if it exists in the _refMap |
It turns _SimpleUri (../../../hook/lib/schema/build_output.schema.json) into _Uri (/hook/lib/schema/build_output.schema.json).
I'm probably holding it wrong. (I don't have $ids for example, and these seem to be used in resolution.) I'm trying to reproduce the behavior I get with the default JSON editor in VSCode, but that seems to work with relative paths in schemas.
Repro:
https://github.com/dart-lang/native/blob/299b683e1c3a8224f2566d803e1431adc3bf37a7/pkgs/code_assets/test/schema/schema_test.dart#L25-L38
Hey! I love this package, and I've been playing around with it to validate JSONs and schemas.
However, I can't seem to use relative paths in refs.
json_schema/lib/src/json_schema/json_schema.dart
Lines 1963 to 1967 in dc39865
It turns
_SimpleUri (../../../hook/lib/schema/build_output.schema.json)into_Uri (/hook/lib/schema/build_output.schema.json).I'm probably holding it wrong. (I don't have
$ids for example, and these seem to be used in resolution.) I'm trying to reproduce the behavior I get with the default JSON editor in VSCode, but that seems to work with relative paths in schemas.Repro:
https://github.com/dart-lang/native/blob/299b683e1c3a8224f2566d803e1431adc3bf37a7/pkgs/code_assets/test/schema/schema_test.dart#L25-L38