-
Notifications
You must be signed in to change notification settings - Fork 90
/
results-object.yaml
171 lines (170 loc) · 5.12 KB
/
results-object.yaml
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
$schema: http://json-schema.org/draft-07/schema#
title: IBM OpenAPI Validator Results Schema
description: The results produced by running the validator on an API definition
type: object
additionalProperties: false
required:
- error
- warning
- info
- hint
- hasResults
properties:
error:
$ref: '#/$defs/ValidationData'
warning:
$ref: '#/$defs/ValidationData'
info:
$ref: '#/$defs/ValidationData'
hint:
$ref: '#/$defs/ValidationData'
hasResults:
type: boolean
description: A convenience flag indicating there is at least one result at any severity level
impactScore:
type: object
description: Data translating the validation results into numeric scores
required:
- categorizedSummary
- scoringData
properties:
categorizedSummary:
type: object
description: Holds the max score for each API impact category
required:
# Must match the category enum values in the "rubric-entry" schema.
- usability
- security
- robustness
- evolution
- overall
properties:
usability:
$ref: '#/$defs/MaxScore'
security:
$ref: '#/$defs/MaxScore'
robustness:
$ref: '#/$defs/MaxScore'
evolution:
$ref: '#/$defs/MaxScore'
overall:
$ref: '#/$defs/MaxScore'
scoringData:
type: array
description: >-
Holds information describing how each rule violation contributes to the max score.
May be empty if only the summary is requested.
items:
type: object
description: The scoring data contributed by a given validator rule
required:
- rule
- count
- func
- demerits
properties:
rule:
type: string
description: The validator rule that was violated
count:
type: integer
description: The number of times the validator rule was violated
minimum: 1
func:
type: string
description: A string representation of the formula used to compute the demerits
demerits:
type: object
description: The categorized, numeric impact a rule violation has on the score
# Must match the category enum values in the "rubric-entry" schema.
properties:
usability:
$ref: '#/$defs/Demerit'
security:
$ref: '#/$defs/Demerit'
robustness:
$ref: '#/$defs/Demerit'
evolution:
$ref: '#/$defs/Demerit'
total:
$ref: '#/$defs/Demerit'
$defs:
ValidationData:
type: object
additionalProperties: false
required:
- results
- summary
properties:
results:
type: array
description: >-
List of results with a given severity. May be empty if only the summary is requested.
items:
$ref: '#/$defs/ValidationResult'
summary:
type: object
additionalProperties: false
required:
- entries
- total
properties:
entries:
type: array
description: List of metadata summarizing the results at a given severity
items:
$ref: '#/$defs/SummaryEntry'
total:
type: integer
description: The total number of validations with a given severity
ValidationResult:
type: object
additionalProperties: false
required:
- message
- path
- rule
- line
properties:
message:
type: string
description: A description of the problem discovered in the API
path:
type: array
items:
type: string
description: An array containing the field names of the API document
that lead to the location of the discovered problem
rule:
type: string
description: The rule identifier in the Spectral ruleset
line:
type: integer
description: The line number in the original file that the problem
was discovered on
SummaryEntry:
type: object
additionalProperties: false
required:
- generalizedMessage
- count
- percentage
properties:
generalizedMessage:
type: string
description: Generalized version of a rule message that has been reported by the validator
count:
type: integer
description: The number of times this specific rule has been violated in the API
percentage:
type: integer
description: The percentage of total violations for a given severity that this rule comprises
MaxScore:
type: integer
description: A number describing the maximum score for an API after accounting for the impact of rule violations
minimum: 0
maximum: 100
Demerit:
type: number
description: A number describing the demerit impact a rule has on an API
minimum: 0.01