- All Superinterfaces:
Prototype.Api
- All Known Implementing Classes:
Schema.BuilderBase.SchemaImpl
Json schema object.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
Fluent API builder forSchema
.static class
Schema.BuilderBase<BUILDER extends Schema.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends Schema> Fluent API builder base forSchema
. -
Method Summary
Modifier and TypeMethodDescriptionstatic Schema.Builder
builder()
Create a new fluent API builder to customize configuration.static Schema.Builder
Create a new fluent API builder from an existing instance.Return a Schema related to the given class.generate()
Generate the String representation of the schema.Generate the String representation of the schema without schema keywords.id()
The base URI for resolving relative references.static Schema
Parse a schema object from the String format of the Json schema.root()
Root schema.Root of the schema should be validated as an array.Root of the schema should be validated as a boolean.Root of the schema should be validated as an integer.rootNull()
Root of the schema should be validated as a null.Root of the schema should be validated as a number.Root of the schema should be validated as an object.Root of the schema should be validated as a string.
-
Method Details
-
builder
Create a new fluent API builder to customize configuration.- Returns:
- a new builder
-
builder
Create a new fluent API builder from an existing instance.- Parameters:
instance
- an existing instance used as a base for the builder- Returns:
- a builder based on an instance
-
find
Return a Schema related to the given class. This schema is obtained from the service registry viaJsonSchemaProvider
instance. One has to either putJsonSchema.Schema
annotation on the requested type or implementJsonSchemaProvider
class manually. If no schema was found for the given class, empty optional is returned.- Parameters:
clazz
- schema class- Returns:
- schema related to the provided class or empty
-
parse
Parse a schema object from the String format of the Json schema.- Parameters:
jsonSchema
- source json schema- Returns:
- parsed schema object
-
generate
String generate()Generate the String representation of the schema.- Returns:
- Json schema in a String format
-
generateNoKeywords
String generateNoKeywords()Generate the String representation of the schema without schema keywords. Keywords like$schema
or$id
will not be included.- Returns:
- Json schema in a String format
-
id
The base URI for resolving relative references.- Returns:
- configured base URI
-
root
SchemaItem root()Root schema.- Returns:
- root json schema
-
rootObject
Optional<SchemaObject> rootObject()Root of the schema should be validated as an object.- Returns:
- object root schema
-
rootArray
Optional<SchemaArray> rootArray()Root of the schema should be validated as an array.- Returns:
- array root schema
-
rootNumber
Optional<SchemaNumber> rootNumber()Root of the schema should be validated as a number.- Returns:
- number root schema
-
rootInteger
Optional<SchemaInteger> rootInteger()Root of the schema should be validated as an integer.- Returns:
- integer root schema
-
rootString
Optional<SchemaString> rootString()Root of the schema should be validated as a string.- Returns:
- string root schema
-
rootBoolean
Optional<SchemaBoolean> rootBoolean()Root of the schema should be validated as a boolean.- Returns:
- boolean root schema
-
rootNull
Optional<SchemaNull> rootNull()Root of the schema should be validated as a null.- Returns:
- null root schema
-