Class JsonSchemaConverter
java.lang.Object
it.uniroma2.art.semanticturkey.properties.json.schema.JsonSchemaConverter
Converters a JSON schema to a
DynamicSTProperties
. This converter supports the following keywords:
- type
- enum
- properties
- required
- minLength
- maxLength
- pattern
- minimum
- maximum
- items
- uniqueItems
- title
- description
- default
The underlying JSON Schema parser is updated to draft v7; however, we encourage to only use keywords that didn't have backward incompatible changes into subsequent specs.
The underlying library looses the order of property declarations: we fixed this problem by joining with the represented obtained through Jackson. Another limitation of the library is the lack of support for default values, which we implemented separately.
- Author:
- Manuel Fiorelli
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconvert
(com.fasterxml.jackson.databind.JsonNode jacksonSchemaNode) org.apache.commons.lang3.tuple.Pair<AnnotatedType,
List<org.apache.commons.lang3.tuple.Pair<Class<? extends Annotation>, Map<String, Object>>>> convertSchemaToAnnotatedTypeAndFieldConstraints
(org.everit.json.schema.Schema schema)
-
Constructor Details
-
JsonSchemaConverter
public JsonSchemaConverter()
-
-
Method Details
-
convert
- Throws:
ConversionException
-
convert
public DynamicSTProperties convert(com.fasterxml.jackson.databind.JsonNode jacksonSchemaNode) throws ConversionException - Throws:
ConversionException
-
convertSchemaToAnnotatedTypeAndFieldConstraints
public org.apache.commons.lang3.tuple.Pair<AnnotatedType,List<org.apache.commons.lang3.tuple.Pair<Class<? extends Annotation>, convertSchemaToAnnotatedTypeAndFieldConstraintsMap<String, Object>>>> (org.everit.json.schema.Schema schema) throws ConversionException - Throws:
ConversionException
-