-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjson_schema_types.go
More file actions
35 lines (30 loc) · 880 Bytes
/
json_schema_types.go
File metadata and controls
35 lines (30 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main
type JsonSchemaType string
const (
JsonSchemaTypeNull JsonSchemaType = "null"
JsonSchemaTypeBoolean = "boolean"
JsonSchemaTypeString = "string"
JsonSchemaTypeInteger = "integer"
JsonSchemaTypeNumber = "number"
JsonSchemaTypeObject = "object"
JsonSchemaTypeArray = "array"
)
var JsonSchemaTypes = [...]JsonSchemaType{
JsonSchemaTypeNull,
JsonSchemaTypeBoolean,
JsonSchemaTypeString,
JsonSchemaTypeInteger,
JsonSchemaTypeNumber,
JsonSchemaTypeObject,
JsonSchemaTypeArray,
}
func (t JsonSchemaType) IsPrimitiveSchemaType() bool {
switch t {
case JsonSchemaTypeNull, JsonSchemaTypeBoolean, JsonSchemaTypeString, JsonSchemaTypeInteger, JsonSchemaTypeNumber:
return true
}
return false
}
func (t JsonSchemaType) String() string {
return string(t)
}