Skip to content

Commit 7d7c0d1

Browse files
rsionnachclaude
andauthored
Add OpenSRM (Open Service Reliability Manifest) schema (#5327)
OpenSRM is an open specification for declaring service reliability requirements as code. It enables shift-left reliability by defining SLOs, contracts, and dependencies before deployment. - Schema: src/schemas/json/opensrm.json (draft-07) - 8 positive tests, 5 negative tests - Added to ajvNotStrictMode (uses anyOf + required patterns) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d54bcad commit 7d7c0d1

File tree

16 files changed

+1465
-0
lines changed

16 files changed

+1465
-0
lines changed

src/api/json/catalog.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4609,6 +4609,19 @@
46094609
"v0.9.0": "https://github.com/bitol-io/open-data-product-standard/blob/main/schema/odps-json-schema-v0.9.0.json"
46104610
}
46114611
},
4612+
{
4613+
"name": "OpenSRM",
4614+
"description": "Open Service Reliability Manifest - Define service reliability requirements as code",
4615+
"fileMatch": [
4616+
"service.reliability.yaml",
4617+
"service.reliability.yml",
4618+
"*.reliability.yaml",
4619+
"*.reliability.yml",
4620+
".opensrm.yaml",
4621+
".opensrm.yml"
4622+
],
4623+
"url": "https://www.schemastore.org/opensrm.json"
4624+
},
46124625
{
46134626
"name": "Outblocks project configuration",
46144627
"description": "Outblocks project configuration files",
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# yaml-language-server: $schema=../../schemas/json/opensrm.json
2+
# This file is INVALID - duration must be in format like '500ms', '30s', '5m'
3+
apiVersion: srm/v1
4+
kind: ServiceReliabilityManifest
5+
metadata:
6+
name: invalid-duration
7+
team: platform
8+
tier: standard
9+
spec:
10+
type: api
11+
slos:
12+
availability:
13+
target: 0.999
14+
latency:
15+
p99: 500 milliseconds
16+
target: 0.99
17+
ownership:
18+
team: platform
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# yaml-language-server: $schema=../../schemas/json/opensrm.json
2+
# This file is INVALID - kind must be 'ServiceReliabilityManifest' or 'Template'
3+
apiVersion: srm/v1
4+
kind: SLODefinition
5+
metadata:
6+
name: invalid-kind
7+
team: platform
8+
tier: standard
9+
spec:
10+
type: api
11+
slos:
12+
availability:
13+
target: 0.999
14+
ownership:
15+
team: platform
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# yaml-language-server: $schema=../../schemas/json/opensrm.json
2+
# This file is INVALID - target must be between 0 and 1
3+
apiVersion: srm/v1
4+
kind: ServiceReliabilityManifest
5+
metadata:
6+
name: invalid-service
7+
team: platform
8+
tier: standard
9+
spec:
10+
type: api
11+
slos:
12+
availability:
13+
target: 99.9
14+
ownership:
15+
team: platform
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# yaml-language-server: $schema=../../schemas/json/opensrm.json
2+
# This file is INVALID - 'cron' is not a valid service type
3+
apiVersion: srm/v1
4+
kind: ServiceReliabilityManifest
5+
metadata:
6+
name: my-cron-job
7+
team: platform
8+
tier: standard
9+
spec:
10+
type: cron
11+
slos:
12+
availability:
13+
target: 0.999
14+
ownership:
15+
team: platform
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# yaml-language-server: $schema=../../schemas/json/opensrm.json
2+
# This file is INVALID - missing required 'name' field in metadata
3+
apiVersion: srm/v1
4+
kind: ServiceReliabilityManifest
5+
metadata:
6+
team: platform
7+
tier: standard
8+
spec:
9+
type: api
10+
slos:
11+
availability:
12+
target: 0.999
13+
ownership:
14+
team: platform

src/schema-validation.jsonc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
"nuget-project-3.3.0.json",
154154
"nuget-project.json",
155155
"openfin.json",
156+
"opensrm.json",
156157
"opspec-io-0.1.7.json",
157158
"package.json",
158159
"package.manifest-8.0.0.json",

0 commit comments

Comments
 (0)