Recursively convert a traversable schema into its JSON schema representation.
Roundtrip property:
Thoroughly tested using randomly generated schemas to be invertible with
fromJsonSchema without any loss of information.
Note: If you find yourself reaching for toJsonSchema,
keep in mind that by installing the @traversable/schema-to-json-schema package,
all of the built-in schemas from the @traversable/schema package come
equipped with a .toJsonSchema getter method.
Prefer using the .toJsonSchema method if possible -- not only is it
easier to use, but it's also more performant, since the implementation
is not recursive.
toJsonSchemaRecursively convert a traversable schema into its JSON schema representation.
Roundtrip property:
Thoroughly tested using randomly generated schemas to be invertible with
fromJsonSchemawithout any loss of information.Note: If you find yourself reaching for
toJsonSchema, keep in mind that by installing the@traversable/schema-to-json-schemapackage, all of the built-in schemas from the@traversable/schemapackage come equipped with a.toJsonSchemagetter method.Prefer using the
.toJsonSchemamethod if possible -- not only is it easier to use, but it's also more performant, since the implementation is not recursive.