Skip to content

Commit 59dd6b8

Browse files
authored
Stop generating errors for body inheritance (#3292) (#4988)
(cherry picked from commit ae611bc) # Conflicts: # output/schema/validation-errors.json
1 parent 4ff24a7 commit 59dd6b8

File tree

2 files changed

+1
-151
lines changed

2 files changed

+1
-151
lines changed

compiler/src/steps/validate-model.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,6 @@ export default async function validateModel (apiModel: model.Model, restSpec: Ma
455455
context.pop()
456456

457457
context.push('body')
458-
if (typeDef.inherits != null && typeDef.body.kind !== 'properties') {
459-
if (fqn(typeDef.inherits.type) !== '_types:RequestBase') {
460-
modelError('A request with inherited properties must have a PropertyBody')
461-
}
462-
}
463458
switch (typeDef.body.kind) {
464459
case 'properties':
465460
validateProperties(typeDef.body.properties, openGenerics, inheritedProps)

output/schema/validation-errors.json

Lines changed: 1 addition & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -8,152 +8,7 @@
88
},
99
"cat.aliases": {
1010
"request": [
11-
"Request: query parameter 'master_timeout' does not exist in the json spec",
12-
"request definition cat.aliases:Request / body - A request with inherited properties must have a PropertyBody"
13-
],
14-
"response": []
15-
},
16-
"cat.allocation": {
17-
"request": [
18-
"request definition cat.allocation:Request / body - A request with inherited properties must have a PropertyBody"
19-
],
20-
"response": []
21-
},
22-
"cat.component_templates": {
23-
"request": [
24-
"request definition cat.component_templates:Request / body - A request with inherited properties must have a PropertyBody"
25-
],
26-
"response": []
27-
},
28-
"cat.count": {
29-
"request": [
30-
"request definition cat.count:Request / body - A request with inherited properties must have a PropertyBody"
31-
],
32-
"response": []
33-
},
34-
"cat.fielddata": {
35-
"request": [
36-
"request definition cat.fielddata:Request / body - A request with inherited properties must have a PropertyBody"
37-
],
38-
"response": []
39-
},
40-
"cat.health": {
41-
"request": [
42-
"request definition cat.health:Request / body - A request with inherited properties must have a PropertyBody"
43-
],
44-
"response": []
45-
},
46-
"cat.indices": {
47-
"request": [
48-
"request definition cat.indices:Request / body - A request with inherited properties must have a PropertyBody"
49-
],
50-
"response": []
51-
},
52-
"cat.master": {
53-
"request": [
54-
"request definition cat.master:Request / body - A request with inherited properties must have a PropertyBody"
55-
],
56-
"response": []
57-
},
58-
"cat.ml_data_frame_analytics": {
59-
"request": [
60-
"request definition cat.ml_data_frame_analytics:Request / body - A request with inherited properties must have a PropertyBody"
61-
],
62-
"response": []
63-
},
64-
"cat.ml_datafeeds": {
65-
"request": [
66-
"request definition cat.ml_datafeeds:Request / body - A request with inherited properties must have a PropertyBody"
67-
],
68-
"response": []
69-
},
70-
"cat.ml_jobs": {
71-
"request": [
72-
"request definition cat.ml_jobs:Request / body - A request with inherited properties must have a PropertyBody"
73-
],
74-
"response": []
75-
},
76-
"cat.ml_trained_models": {
77-
"request": [
78-
"request definition cat.ml_trained_models:Request / body - A request with inherited properties must have a PropertyBody"
79-
],
80-
"response": []
81-
},
82-
"cat.nodeattrs": {
83-
"request": [
84-
"request definition cat.nodeattrs:Request / body - A request with inherited properties must have a PropertyBody"
85-
],
86-
"response": []
87-
},
88-
"cat.nodes": {
89-
"request": [
90-
"request definition cat.nodes:Request / body - A request with inherited properties must have a PropertyBody"
91-
],
92-
"response": []
93-
},
94-
"cat.pending_tasks": {
95-
"request": [
96-
"request definition cat.pending_tasks:Request / body - A request with inherited properties must have a PropertyBody"
97-
],
98-
"response": []
99-
},
100-
"cat.plugins": {
101-
"request": [
102-
"request definition cat.plugins:Request / body - A request with inherited properties must have a PropertyBody"
103-
],
104-
"response": []
105-
},
106-
"cat.recovery": {
107-
"request": [
108-
"request definition cat.recovery:Request / body - A request with inherited properties must have a PropertyBody"
109-
],
110-
"response": []
111-
},
112-
"cat.repositories": {
113-
"request": [
114-
"request definition cat.repositories:Request / body - A request with inherited properties must have a PropertyBody"
115-
],
116-
"response": []
117-
},
118-
"cat.segments": {
119-
"request": [
120-
"request definition cat.segments:Request / body - A request with inherited properties must have a PropertyBody"
121-
],
122-
"response": []
123-
},
124-
"cat.shards": {
125-
"request": [
126-
"request definition cat.shards:Request / body - A request with inherited properties must have a PropertyBody"
127-
],
128-
"response": []
129-
},
130-
"cat.snapshots": {
131-
"request": [
132-
"request definition cat.snapshots:Request / body - A request with inherited properties must have a PropertyBody"
133-
],
134-
"response": []
135-
},
136-
"cat.tasks": {
137-
"request": [
138-
"request definition cat.tasks:Request / body - A request with inherited properties must have a PropertyBody"
139-
],
140-
"response": []
141-
},
142-
"cat.templates": {
143-
"request": [
144-
"request definition cat.templates:Request / body - A request with inherited properties must have a PropertyBody"
145-
],
146-
"response": []
147-
},
148-
"cat.thread_pool": {
149-
"request": [
150-
"request definition cat.thread_pool:Request / body - A request with inherited properties must have a PropertyBody"
151-
],
152-
"response": []
153-
},
154-
"cat.transforms": {
155-
"request": [
156-
"request definition cat.transforms:Request / body - A request with inherited properties must have a PropertyBody"
11+
"Request: query parameter 'master_timeout' does not exist in the json spec"
15712
],
15813
"response": []
15914
},

0 commit comments

Comments
 (0)