Search in sources :

Example 1 with XmlTypeToJsonSchemaConverter

use of nl.nn.adapterframework.align.XmlTypeToJsonSchemaConverter in project iaf by ibissource.

the class ApiServiceDispatcher method addComponentsToTheSchema.

private void addComponentsToTheSchema(JsonObjectBuilder schemas, List<XSModel> models) {
    XmlTypeToJsonSchemaConverter converter = new XmlTypeToJsonSchemaConverter(models, true, SCHEMA_DEFINITION_PATH);
    JsonObject jsonSchema = converter.getDefinitions();
    if (jsonSchema != null) {
        for (Entry<String, JsonValue> entry : jsonSchema.entrySet()) {
            schemas.add(entry.getKey(), entry.getValue());
        }
    }
}
Also used : XmlTypeToJsonSchemaConverter(nl.nn.adapterframework.align.XmlTypeToJsonSchemaConverter) JsonValue(javax.json.JsonValue) JsonObject(javax.json.JsonObject)

Example 2 with XmlTypeToJsonSchemaConverter

use of nl.nn.adapterframework.align.XmlTypeToJsonSchemaConverter in project iaf by ibissource.

the class Json2XmlValidator method createJsonSchema.

public JsonStructure createJsonSchema(String elementName, String namespace) {
    List<XSModel> models = validator.getXSModels();
    XmlTypeToJsonSchemaConverter converter = new XmlTypeToJsonSchemaConverter(models, isCompactJsonArrays(), !isJsonWithRootElements(), getSchemaLocation());
    JsonStructure jsonschema = converter.createJsonSchema(elementName, namespace);
    return jsonschema;
}
Also used : XmlTypeToJsonSchemaConverter(nl.nn.adapterframework.align.XmlTypeToJsonSchemaConverter) XSModel(org.apache.xerces.xs.XSModel) JsonStructure(javax.json.JsonStructure)

Example 3 with XmlTypeToJsonSchemaConverter

use of nl.nn.adapterframework.align.XmlTypeToJsonSchemaConverter in project iaf by ibissource.

the class Json2XmlValidator method createJsonSchemaDefinitions.

public JsonObject createJsonSchemaDefinitions(String definitionsPath) {
    List<XSModel> models = validator.getXSModels();
    XmlTypeToJsonSchemaConverter converter = new XmlTypeToJsonSchemaConverter(models, isCompactJsonArrays(), !isJsonWithRootElements(), getSchemaLocation(), definitionsPath);
    JsonObject jsonschema = converter.getDefinitions();
    return jsonschema;
}
Also used : XmlTypeToJsonSchemaConverter(nl.nn.adapterframework.align.XmlTypeToJsonSchemaConverter) XSModel(org.apache.xerces.xs.XSModel) JsonObject(javax.json.JsonObject)

Aggregations

XmlTypeToJsonSchemaConverter (nl.nn.adapterframework.align.XmlTypeToJsonSchemaConverter)3 JsonObject (javax.json.JsonObject)2 XSModel (org.apache.xerces.xs.XSModel)2 JsonStructure (javax.json.JsonStructure)1 JsonValue (javax.json.JsonValue)1