Class SchemaUtil.Builder
java.lang.Object
com.inductiveautomation.ignition.gateway.dataroutes.openapi.SchemaUtil.Builder
- Enclosing class:
- SchemaUtil
A builder for creating JSON schemas.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadditionalProperties
(Consumer<SchemaUtil.Builder> subSchema) final SchemaUtil.Builder
allOf
(Consumer<SchemaUtil.Builder>... subSchemas) final SchemaUtil.Builder
anyOf
(Consumer<SchemaUtil.Builder>... subSchemas) com.inductiveautomation.ignition.common.gson.JsonObject
build()
Sets the "const" property of the schema to the given value.contentEncoding
(String contentEncoding) contribute
(Consumer<SchemaUtil.Builder> contributor) copy
(com.inductiveautomation.ignition.common.gson.JsonObject copy) defaultValue
(boolean value) Sets the default value for the bool type schema.defaultValue
(com.inductiveautomation.ignition.common.gson.JsonElement value) Sets the default value for the schema.defaultValue
(Number value) Sets the default value for the number type schema.description
(String description) descriptionKey
(String descriptionKey) enumeration
(Object... values) example
(com.inductiveautomation.ignition.common.gson.JsonElement example) formFieldSetting
(FormSetting key, com.inductiveautomation.ignition.common.gson.JsonElement value) Adds a UI form field setting for this property.items
(com.inductiveautomation.ignition.common.gson.JsonObject jsonObject) Shortcut to create an "items" sub schema with the given schema JsonObject.Shortcut to create an items sub schema with only a type specifieditems
(Consumer<SchemaUtil.Builder> subSchema) Sets the required schema for items.maximum
(int maximum, boolean exclusive) maxLength
(int maxLength) minimum
(int minimum, boolean exclusive) minLength
(int minLength) nonSecret
(boolean isNonSecret) Marks the most recently added property as non-secret.not
(Consumer<SchemaUtil.Builder> subSchema) final SchemaUtil.Builder
oneOf
(Iterable<Consumer<SchemaUtil.Builder>> subSchemas) final SchemaUtil.Builder
oneOf
(Consumer<SchemaUtil.Builder>... subSchemas) Add a basic property to the schema, with just a type identifier.property
(String name, Consumer<SchemaUtil.Builder> subSchema) propertyNames
(Consumer<SchemaUtil.Builder> subSchema) removeProperty
(String name) Removes a property previously added.required()
Adds the most recently added property to the required list.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
copy
-
id
-
type
-
title
-
description
-
descriptionKey
-
ref
-
propertyNames
-
property
Add a basic property to the schema, with just a type identifier. -
property
-
property
-
removeProperty
Removes a property previously added. Can be useful to conditionally hide properties discovered through reflection. -
enumeration
-
constant
Sets the "const" property of the schema to the given value. Also invokestype(JsonType)
with the type of the value. -
nonSecret
Marks the most recently added property as non-secret. This is used to pass validation checking for properties the system feels might contain a secret.- Parameters:
isNonSecret
- true if the property should be marked as non-secret, false otherwise.
-
required
Adds the most recently added property to the required list. Usage example:builder.property("name", JsonType.STRING).required();
-
defaultValue
public SchemaUtil.Builder defaultValue(com.inductiveautomation.ignition.common.gson.JsonElement value) Sets the default value for the schema. See the json-schema.org reference- Parameters:
value
- The default value.- Returns:
- This builder.
-
defaultValue
Sets the default value for the bool type schema.- Parameters:
value
- The default value.- Returns:
- This builder.
-
defaultValue
Sets the default value for the number type schema.- Parameters:
value
- The default value.- Returns:
- This builder.
-
items
Sets the required schema for items. Used for when type="array" -
items
Shortcut to create an items sub schema with only a type specified -
items
Shortcut to create an "items" sub schema with the given schema JsonObject.- Parameters:
jsonObject
- the schema to use for the items.- Returns:
- this builder.
-
additionalPropertiesFalse
-
additionalProperties
-
oneOf
-
oneOf
-
allOf
-
anyOf
-
not
-
format
-
contentEncoding
-
example
-
minLength
-
maxLength
-
pattern
-
minimum
-
minimum
-
maximum
-
maximum
-
contribute
-
build
public com.inductiveautomation.ignition.common.gson.JsonObject build()
-