PropertySchema class
表示在 JSON 架构中找到的属性。
构造函数
Property |
创建新的 |
属性
children | 子属性(如果有)。 |
entities | 实体名称列表。 |
expected |
仅预期实体名称的列表。 |
name | 此属性的名称。 |
parent | 父属性架构(如果有)。 |
path | 架构的路径。 |
schema | 此属性的 JSON 架构对象。 |
type | JSON 架构类型。 |
方法
is |
|
is |
构造函数详细信息
PropertySchema(string, object, PropertySchema[])
创建新的 PropertySchema
实例。
new PropertySchema(path: string, schema: object, children?: PropertySchema[])
参数
- path
-
string
此属性的路径。
- schema
-
object
此属性的 JSON 架构片段。
- children
自选。 子属性。
属性详细信息
children
entities
实体名称列表。
string[] entities
属性值
string[]
实体名称的列表。
expectedOnly
仅预期实体名称的列表。
string[] expectedOnly
属性值
string[]
仅限实体名称的列表。
name
此属性的名称。
string name
属性值
string
此属性的名称。
注解
将删除 []
的数组括号。
parent
path
架构的路径。
path: string
属性值
string
注解
包含数组的 []
,以及路径段的 .
。
schema
此属性的 JSON 架构对象。
schema: object
属性值
object
type
JSON 架构类型。
string type
属性值
string
JSON 架构类型。
方法详细信息
isArray()
function isArray(): boolean
返回
boolean
如果属性是数组,则 true
。
isEnum()
function isEnum(): boolean
返回
boolean
如果属性是枚举,则 true
。