-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrulesets.schema.json
More file actions
94 lines (94 loc) · 4.17 KB
/
Copy pathrulesets.schema.json
File metadata and controls
94 lines (94 loc) · 4.17 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://rulesets.apicommons.org/rulesets.schema.json",
"title": "API Governance Ruleset Registry",
"description": "A machine-readable registry of adoptable, provenanced API-governance rulesets. Each entry describes an owned ruleset a team can adopt by reference — its provenance, source, how to consume it, and whether it is a governed standard or a tool default.",
"type": "object",
"required": ["name", "version", "rulesets"],
"properties": {
"$schema": { "type": "string" },
"name": { "type": "string" },
"description": { "type": "string" },
"version": { "type": "string" },
"url": { "type": "string", "format": "uri" },
"source": { "type": "string", "format": "uri" },
"categories": {
"type": "object",
"description": "Human-readable descriptions of each category value.",
"additionalProperties": { "type": "string" }
},
"rulesets": {
"type": "array",
"items": { "$ref": "#/$defs/ruleset" }
}
},
"$defs": {
"ruleset": {
"type": "object",
"required": ["id", "name", "publisher", "category", "description", "provenance", "sourceUrl", "adoptVia", "artifactTypes", "governed"],
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z0-9][a-z0-9-]*$",
"description": "Stable, lowercase, hyphenated identifier."
},
"name": { "type": "string", "description": "Display name of the ruleset." },
"publisher": { "type": "string", "description": "The organization or person that publishes it." },
"category": {
"type": "string",
"enum": ["national", "industry", "security", "vendor-default", "community", "company"],
"description": "What kind of source this ruleset is. 'vendor-default' means a tool's built-in config, not an owned standard."
},
"description": { "type": "string", "description": "One-to-three sentence summary of what the ruleset enforces." },
"provenance": {
"type": "object",
"description": "Who owns and maintains the ruleset, and where that ownership is documented.",
"required": ["owner", "url"],
"additionalProperties": false,
"properties": {
"owner": { "type": "string", "description": "The accountable owner/maintainer." },
"url": { "type": "string", "format": "uri", "description": "Canonical URL documenting the owner (repo, org page, or docs)." }
}
},
"sourceUrl": {
"type": "string",
"format": "uri",
"description": "The repository or raw source where the ruleset lives."
},
"adoptVia": {
"type": "object",
"description": "How a team consumes the ruleset in their own project.",
"required": ["method", "value"],
"additionalProperties": false,
"properties": {
"method": {
"type": "string",
"enum": ["extends", "npm", "copy"],
"description": "extends = remote URL referenced from a linter config; npm = installable package; copy = built-in/config to paste."
},
"value": {
"type": "string",
"description": "The remote extends URL, the npm package name, or the config snippet to copy."
},
"note": { "type": "string", "description": "Optional adoption guidance." }
}
},
"artifactTypes": {
"type": "array",
"description": "Which API artifact types the ruleset governs.",
"minItems": 1,
"items": {
"type": "string",
"enum": ["openapi", "asyncapi", "arazzo", "graphql", "json-schema", "apis-json", "overlay", "oauth-metadata"]
}
},
"governed": {
"type": "boolean",
"description": "true = an owned, provenanced standard carrying naming/ownership/domain rules; false = a tool default / ad-hoc config."
},
"notes": { "type": "string", "description": "Free-form context, provenance detail, or adoption evidence." }
}
}
}
}