PropertySchema class
Represents a property found in a JSON schema.
Constructors
| Property |
Creates a new |
Properties
| children | Child properties if there are any. |
| entities | List of entity names. |
| expected |
List of expected only entity names. |
| name | Name for this property. |
| parent | Parent property schema if any. |
| path | Path to schema. |
| schema | JSON Schema object for this property. |
| type | JSON Schema type. |
Constructor Details
PropertySchema(string, object, PropertySchema[])
Creates a new PropertySchema instance.
new PropertySchema(path: string, schema: object, children?: PropertySchema[])
Parameters
- path
-
string
Path to this property.
- schema
-
object
JSON schema fragment for this property.
- children
Optional. Child properties.
Property Details
children
Child properties if there are any.
PropertySchema[] children
Property Value
The child properties if there are any.
entities
List of entity names.
string[] entities
Property Value
string[]
A list of entity names.
expectedOnly
List of expected only entity names.
string[] expectedOnly
Property Value
string[]
A List of expected only entity names.
name
Name for this property.
string name
Property Value
string
The name for this property.
Remarks
Array brackets [] will have been removed.
parent
Parent property schema if any.
PropertySchema | undefined parent
Property Value
PropertySchema | undefined
The parent property schema if any.
path
Path to schema.
path: string
Property Value
string
Remarks
Contains [] for arrays and . for path segments.
schema
JSON Schema object for this property.
schema: object
Property Value
object
type
JSON Schema type.
string type
Property Value
string
The JSON Schema type.
Method Details
isArray()
function isArray(): boolean
Returns
boolean
true if the property is an array.
isEnum()
function isEnum(): boolean
Returns
boolean
true if the property is an enum.