Skip to content

Commit 07e96eb

Browse files
committed
feat: adding location-types.schema
1 parent 3e3dae8 commit 07e96eb

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

schema/location-types.schema.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://rackerlabs.github.io/understack/schema/location-types.schema.json",
4+
"title": "UnderStack Location Types",
5+
"description": "Hierarchical location type configuration schema for Nautobot location organization",
6+
"type": "array",
7+
"items": {
8+
"$ref": "#/$defs/locationType"
9+
},
10+
"minItems": 1,
11+
"$defs": {
12+
"locationType": {
13+
"type": "object",
14+
"description": "A location type definition with optional nested children",
15+
"properties": {
16+
"name": {
17+
"description": "Name of the location type",
18+
"type": "string",
19+
"minLength": 1
20+
},
21+
"description": {
22+
"description": "Human-readable description of the location type",
23+
"type": "string"
24+
},
25+
"content_types": {
26+
"description": "List of Nautobot content types that can be associated with this location type (e.g., 'dcim.device', 'ipam.vlan', 'ipam.namespace')",
27+
"type": "array",
28+
"items": {
29+
"type": "string",
30+
"pattern": "^[a-z_]+\\.[a-z_]+$"
31+
},
32+
"uniqueItems": true
33+
},
34+
"nestable": {
35+
"description": "Whether this location type can contain nested locations of the same type",
36+
"type": "boolean"
37+
},
38+
"children": {
39+
"description": "Child location types nested under this location type",
40+
"type": "array",
41+
"items": {
42+
"$ref": "#/$defs/locationType"
43+
}
44+
}
45+
},
46+
"required": ["name", "description", "content_types", "nestable"],
47+
"additionalProperties": false
48+
}
49+
}
50+
}

0 commit comments

Comments
 (0)