All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.networknt.schema.Version7 Maven / Gradle / Ivy

There is a newer version: 1.5.3
Show newest version
package com.networknt.schema;

import java.util.Arrays;

public class Version7 extends JsonSchemaVersion{
    private static final String URI = SchemaId.V7;
    private static final String ID = "$id";

    static {
        // add version specific formats here.
        //BUILTIN_FORMATS.add(pattern("phone", "^\\+(?:[0-9] ?){6,14}[0-9]$"));
    }
    @Override
    public JsonMetaSchema getInstance() {
        return new JsonMetaSchema.Builder(URI)
                .specification(SpecVersion.VersionFlag.V7)
                .idKeyword(ID)
                .addFormats(BUILTIN_FORMATS)
                .addKeywords(ValidatorTypeCode.getNonFormatKeywords(SpecVersion.VersionFlag.V7))
                // keywords that may validly exist, but have no validation aspect to them
                .addKeywords(Arrays.asList(
                        new NonValidationKeyword("$schema", false),
                        new NonValidationKeyword("$id", false),
                        new NonValidationKeyword("title"),
                        new NonValidationKeyword("description"),
                        new NonValidationKeyword("default"),
                        new NonValidationKeyword("definitions", false),
                        new NonValidationKeyword("$comment"),
                        new NonValidationKeyword("examples"),
                        new NonValidationKeyword("then"),
                        new NonValidationKeyword("else"),
                        new NonValidationKeyword("additionalItems"),
                        new NonValidationKeyword("message", false)
                ))
                .build();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy