final case class NumberSchema(properties: SchemaProperties[BigDecimal] = NumberSchema.AllProperties) extends JsonSchema[BigDecimal] with Product with Serializable
Represents numbers in JSON Schema.
- Alphabetic
- By Inheritance
- NumberSchema
- Serializable
- Product
- Equals
- JsonSchema
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new NumberSchema(properties: SchemaProperties[BigDecimal] = NumberSchema.AllProperties)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addDefinition(definition: JsonSchema[_], name: String): Unit
Add a new definition to the set of definitions.
Add a new definition to the set of definitions.
- definition
the new definition to add
- name
the name of the definition
- Definition Classes
- JsonSchema
- Annotations
- @SuppressWarnings()
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def collectAnomalies[S <: JValue](value: S, path: String = "$")(implicit p: JsonoidParams, tag: ClassTag[S]): Seq[Anomaly]
Produce a list of anomalies when validating a given value.
Produce a list of anomalies when validating a given value.
- value
the value to check for anomalies
- path
the path where this anomaly is being checked
- returns
a sequence of anomalies observed for this value
- Definition Classes
- JsonSchema
- def copy(properties: SchemaProperties[BigDecimal]): NumberSchema
Create a copy of this schema with a new set of properties.
Create a copy of this schema with a new set of properties.
- Definition Classes
- NumberSchema → JsonSchema
- Annotations
- @SuppressWarnings()
- def copyWithReset()(implicit p: JsonoidParams): JsonSchema[BigDecimal]
Create a copy of this schema with the same set of properties, but with each property set to their default value.
Create a copy of this schema with the same set of properties, but with each property set to their default value.
- Definition Classes
- JsonSchema
- def createProduct()(implicit p: JsonoidParams): PartialFunction[JsonSchema[_], JsonSchema[_]]
A function which creates a new product schema.
A function which creates a new product schema.
- Definition Classes
- JsonSchema
- val definitions: Map[String, JsonSchema[_]]
A set of definitions used to express repeated structures.
A set of definitions used to express repeated structures.
- Definition Classes
- JsonSchema
- Annotations
- @SuppressWarnings()
- def entropy(implicit p: JsonoidParams): Option[Long]
The number of possible types accepted by this schema.
The number of possible types accepted by this schema. It must be overridden by subclasses to do anything useful.
- returns
the number of types or None if entropy cannot be calculated
- Definition Classes
- JsonSchema
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def expandTo[S](other: Option[JsonSchema[S]]): JsonSchema[_]
Expand this schema to be compatible with another schema if possible.
Expand this schema to be compatible with another schema if possible.
- other
the other schema to expand to
- returns
a possibly expanded schema to be compatible with the other
- Definition Classes
- JsonSchema
- Annotations
- @SuppressWarnings()
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def findByInexactPointer(pointer: JsonPointer): Seq[JsonSchema[_]]
Find a nested schema based on an *inexact* JSON pointer.
Find a nested schema based on an *inexact* JSON pointer. Inexact pointers do not include which array element is being used or which schema within a ProductSchema is being referenced.
- Definition Classes
- JsonSchema
- Annotations
- @SuppressWarnings()
- def findByPointer(pointer: JsonPointer): Option[JsonSchema[_]]
Finda nested schema based on a JSON Pointer.
Finda nested schema based on a JSON Pointer.
- Definition Classes
- JsonSchema
- Annotations
- @SuppressWarnings()
- def findIncompatibilities(other: JsonSchema[_], recursive: Boolean): Seq[ClassTag[_]]
Find incompatibilities with this schema and another schema.
Find incompatibilities with this schema and another schema.
- other
the other schema to compare with
- recursive
whether to recursively compare the schemas
- returns
a sequence of properties which are incompatible
- Definition Classes
- JsonSchema
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hasType: Boolean
Whether schemaType has any meaning for this schema class.
Whether schemaType has any meaning for this schema class.
- Definition Classes
- JsonSchema
- def isAnomalous[S <: JValue](value: S, path: String = "$", level: AnomalyLevel = AnomalyLevel.Info)(implicit tag: ClassTag[S], p: JsonoidParams): Boolean
Whether a value at a particular path is anomalous.
Whether a value at a particular path is anomalous.
- value
the value to check for anomalies
- path
the path where this anomaly is being checked
- returns
true if the value is anomalous, false otherwise
- Definition Classes
- JsonSchema
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isMaxMin: Boolean
Whether this schema either accepts all or no values.
Whether this schema either accepts all or no values.
- Definition Classes
- JsonSchema
- val isNumeric: Boolean
Whether this schema is numeric.
Whether this schema is numeric.
- Definition Classes
- NumberSchema → JsonSchema
- def isSubsetOf(other: JsonSchema[_], recursive: Boolean = true)(implicit p: JsonoidParams): Boolean
Check whether this schema is compatible with antoher schema.
Check whether this schema is compatible with antoher schema.
- other
the other schema to compare with
- recursive
whether to recursively compare the schemas
- returns
true if this schema is compatible with the other, false otherwise
- Definition Classes
- NumberSchema → JsonSchema
- def isValidType[S <: JValue](value: S): Boolean
Whether a given value is a valid type for this schema.
Whether a given value is a valid type for this schema.
- Definition Classes
- JsonSchema
- def maxAnomalyLevel[S <: JValue](value: S, path: String = "$")(implicit tag: ClassTag[S], p: JsonoidParams): Option[AnomalyLevel]
Whether a value at a particular path is anomalous.
Whether a value at a particular path is anomalous.
- value
the value to check for anomalies
- path
the path where this anomaly is being checked
- returns
true if the value is anomalous, false otherwise
- Definition Classes
- JsonSchema
- Annotations
- @SuppressWarnings()
- def merge(other: JsonSchema[_], mergeType: MergeType = Union)(implicit p: JsonoidParams): JsonSchema[_]
Merge multiple schemas together.
Merge multiple schemas together.
- other
the schema to merge with
- mergeType
the type of merge to perform
- returns
the merged schema
- Definition Classes
- JsonSchema
- Annotations
- @SuppressWarnings()
- def mergeSameType(mergeType: MergeType)(implicit p: JsonoidParams): PartialFunction[JsonSchema[_], JsonSchema[_]]
Merge two schemas which are of the same basic type.
Merge two schemas which are of the same basic type.
- Definition Classes
- NumberSchema → JsonSchema
- Annotations
- @SuppressWarnings()
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def onlyProperties(props: Seq[Class[_]]): JsonSchema[BigDecimal]
Update a schema to only include a specific set of properties.
Update a schema to only include a specific set of properties.
- props
the properties to include
- returns
a new schema with only the specified properties
- Definition Classes
- JsonSchema
- def onlyPropertiesNamed(props: Seq[String]): JsonSchema[BigDecimal]
Update a schema to only include a specific named set of properties.
Update a schema to only include a specific named set of properties.
- props
the names properties to include
- returns
a new schema with only the specified properties
- Definition Classes
- JsonSchema
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val properties: SchemaProperties[BigDecimal]
A set of properties wh
A set of properties wh
- Definition Classes
- NumberSchema → JsonSchema
- def replace(pointer: JsonPointer, replacer: (JsonSchema[_]) => JsonSchema[_])(implicit p: JsonoidParams): JsonSchema[_]
- Definition Classes
- JsonSchema
- def replaceWithReference(pointer: JsonPointer, reference: String, obj: Option[JsonSchema[_]] = None)(implicit p: JsonoidParams): JsonSchema[_]
Replace a schema at a particular pointer with a reference to another schema.
Replace a schema at a particular pointer with a reference to another schema.
- pointer
the JSON pointer to the schema to replace
- reference
the reference to use in the new schema
- obj
an optional object which represents the referenced schema
- returns
a new schema with a reference
- Definition Classes
- JsonSchema
- def replaceWithSchema(pointer: JsonPointer, replaceSchema: JsonSchema[_])(implicit p: JsonoidParams): JsonSchema[_]
Replace a schema at a particular pointer with a new schema.
Replace a schema at a particular pointer with a new schema.
- pointer
the JSON pointer to the schema to replace
- replaceSchema
the schema to replace with
- returns
a new schema with the referenced schema replaced
- Definition Classes
- JsonSchema
- val schemaType: String
A string representing the type of this schema.
A string representing the type of this schema.
- Definition Classes
- NumberSchema → JsonSchema
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toJson()(implicit p: JsonoidParams): JObject
Convert the schema to JSON Schema.
Convert the schema to JSON Schema.
- Definition Classes
- JsonSchema
- Annotations
- @SuppressWarnings()
- def toJsonSchema()(implicit p: JsonoidParams): JObject
Convert the schema to JSON Schema with the schema version specified.
Convert the schema to JSON Schema with the schema version specified.
- Definition Classes
- JsonSchema
- def transformProperties(transformer: PartialFunction[JsonSchema[_], JsonSchema[_]], transformBase: Boolean = false): JsonSchema[_]
Transform all the properties in this schema and any nested schemas according to a specified function.
Transform all the properties in this schema and any nested schemas according to a specified function.
- transformer
the function to transform the properties
- transformBase
whether to also transform this schema
- returns
a new schema with transformed properties
- Definition Classes
- JsonSchema
- def transformPropertiesWithInexactPath(transformer: PartialFunction[(String, JsonSchema[_]), JsonSchema[_]], transformBase: Boolean = false, path: String = "$"): JsonSchema[_]
A variant of transformProperties, which also provides the path to the transformer function.
A variant of transformProperties, which also provides the path to the transformer function. This path is *inexact* in that it does not include which array element is being used or which schema within a ProductSchema is being referenced.
- transformer
the function to transform the properties
- transformBase
whether to also transform this schema
- path
the base of the inexact path
- Definition Classes
- JsonSchema
- Annotations
- @SuppressWarnings()
- val validTypes: Set[Class[_]]
The set of valid types that can be contained in this schema.
The set of valid types that can be contained in this schema.
- Definition Classes
- NumberSchema → JsonSchema
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()