Package jsonvalues.spec
Class SpecToJsonSchema
java.lang.Object
jsonvalues.spec.SpecToJsonSchema
This class is designed for converting JSON specifications into JSON schemas represented by a JsObj. It adheres to the
structure defined in the draft at .... It is important to
note that not all keywords from the draft are supported, but rather only those that are pertinent to json-spec.
However, these supported keywords are comprehensive enough to effectively convey the structure of the JSON. Unlike
JSON schema, json-spec allows for the definition of arbitrary validations, as predicates can be used to validate
data.
-
Method Details
-
convert
Converts a JsObjSpec to a JSON schema.- Parameters:
jsObjSpec
- The JsObjSpec to be converted.- Returns:
- The resulting JSON schema as a JsObj.
-
convert
Converts a spec to a JSON schema.- Parameters:
spec
- The spec to be converted.- Returns:
- The resulting JSON schema as a JsObj.
-
convert
Converts a JsArraySpec to a JSON schema (JsObj).- Parameters:
jsArraySpec
- The JsArraySpec to be converted.- Returns:
- The resulting JSON schema as a JsObj.
-