add custom type library

trunk
HeNine 2 years ago
parent 4f2bc17752
commit 0151eb5386

@ -1,3 +1,5 @@
local types = import "types.libsonnet";
{ {
'$id': 'https://picc.app/schemata/v0.1-dev/entity', '$id': 'https://picc.app/schemata/v0.1-dev/entity',
'$schema': 'http://json-schema.org/draft-07/schema', '$schema': 'http://json-schema.org/draft-07/schema',
@ -9,17 +11,7 @@
|||, |||,
type: 'object', type: 'object',
properties: { properties: {
id: { id: types.id,
description: |||
Identifier that is unique within a server.
It consists of a string of numbers, upper and/or lower case letters, and special cheracters `-` and `_`.
|||,
type: 'string',
minLength: 1,
maxLength: 50,
pattern: '^[0-9a-zA-Z-_]+$',
},
name: { name: {
type: 'string', type: 'string',
description: ||| description: |||

@ -0,0 +1,39 @@
{
id: {
description: |||
Identifier that is unique within a server.
It consists of a string of numbers, upper and/or lower case letters, and special cheracter `-`.
|||,
type: 'string',
minLength: 1,
maxLength: 50,
pattern: '^[0-9a-zA-Z-]+$',
},
location: {
description: |||
Coordinates of a specific location in the WGS 84 datum.
|||,
type: 'object',
properties: {
latitude: {
type: 'number',
description: "Latitude",
minimum: -90,
maximum: 90,
},
longitude: {
type: 'number',
description: "Longitude",
minimum: -180,
maximum: 180,
},
altitude: {
description: "Altitude",
type: 'number',
},
},
required: ["latitude", "longitude", "altitude"]
},
}
Loading…
Cancel
Save