Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.jackson.databind.jsonschema;
Container for a logical JSON Schema instance. Internally schema data is stored as a JSON Tree (instance of com.fasterxml.jackson.databind.JsonNode is the root of schema document)

Ryan Heaton
See also:
JSON Schema
public class JsonSchema
    private final ObjectNode schema;

Main constructor for schema instances.

This is the creator constructor used by Jackson itself when deserializing instances. It is so-called delegating creator, meaning that its argument will be bound by Jackson before constructor gets called.

    public JsonSchema(ObjectNode schema)
        this. = schema;

Method for accessing root JSON object of the contained schema.

Note: this method is specified with com.fasterxml.jackson.annotation.JsonValue annotation to represent serialization to use; same as if explicitly serializing returned object.

Root node of the schema tree
    public ObjectNode getSchemaNode()
        return ;
    public String toString()
        return this..toString();
    public boolean equals(Object o)
        if (o == thisreturn true;
        if (o == nullreturn false;
        if (!(o instanceof JsonSchema)) return false;
        JsonSchema other = (JsonSchemao;
        if ( == null) {
            return other.schema == null;
        return .equals(other.schema);

Get the default schema node.

The default schema node.
    public static JsonNode getDefaultSchemaNode()
        ObjectNode objectNode = ..objectNode();
        // "required" is false by default, no need to include
        //objectNode.put("required", false);
        return objectNode;
New to GrepCode? Check out our FAQ X