Class: ProcessSchema

ProcessSchema(schemaopt, defaultValueopt)

Wrapper class for the process schemas (i.e. from parameters or return value).

Constructor

new ProcessSchema(schemaopt, defaultValueopt)

Constructs a new process schema based on the openEO API representation. Can be array or JSON Schema object. The array consists of multiple JSON Schemas then.
Parameters:
Name Type Attributes Default Description
schema object | array <optional>
null
defaultValue * <optional>
Source:

Methods

dataType(nativeopt) → {string}

Returns the data type of the associated schemas. Setting `native` to `true` will only consider native JSON data types and "any". Otherwise, subtypes will also be considered. If the schema has a two data types and one of them is `null`, `null` is ignored and just the other data type is returned. `nullable()` can be used to check whether a schema allows `null`. Returns `mixed` if multiple data types are allowed.
Parameters:
Name Type Attributes Default Description
native boolean <optional>
false
Source:
See:
Returns:
Type
string

dataTypes(includeNullopt, nativeopt) → {array.<string>}

Returns a set of all supported distinct data types (or 'any'). By default, `null` is not included in the list of data types. Setting `includeNull` to `true` to include `null` in the list. Setting `native` to `true` will only consider native JSON data types and "any". Otherwise, subtypes will also be considered.
Parameters:
Name Type Attributes Default Description
includeNull boolean <optional>
false
native boolean <optional>
false
Source:
Returns:
Type
array.<string>

is(type) → {boolean}

Checks whether the schema is exactly and only of the given data type. Can be a native type or a openEO "subtype".
Parameters:
Name Type Description
type string
Source:
Returns:
Type
boolean

isEditable() → {boolean}

Returns whether the schema is editable. This means it returns `true`, unless certain data types are detected that can't be transmitted via JSON in the openEO API (e.g. data cubes or labeled arrays).
Source:
Returns:
Type
boolean

nativeDataType() → {string}

Returns the native data type of the schema. One of: array, object, null, string, boolean, number
Source:
Returns:
Type
string

nullable() → {boolean}

Checks whether one of the schemas allows the value to be `null`.
Source:
Returns:
Type
boolean

toJSON() → {object}

Converts the schemas to a JSON-serializable representation.
Source:
Returns:
Type
object