Skip to content

Commit d15f0f5

Browse files
authored
Merge branch 'main' into api-examples-pt7
2 parents bb2736e + d9bf86f commit d15f0f5

File tree

96 files changed

+1470
-859
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1470
-859
lines changed

compiler/src/steps/validate-rest-spec.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -161,30 +161,30 @@ export default async function validateRestSpec (model: model.Model, jsonSpec: Ma
161161
if (definition.body.kind !== 'no_body') {
162162
body = Body.yesBody
163163
}
164+
165+
if (definition.attachedBehaviors != null) {
166+
for (const attachedBehavior of definition.attachedBehaviors) {
167+
const type_ = getDefinition({
168+
namespace: '_spec_utils',
169+
name: attachedBehavior
170+
})
171+
if (
172+
type_.kind === 'interface' &&
173+
// allowing CommonQueryParameters too generates many errors
174+
attachedBehavior === 'CommonCatQueryParameters'
175+
) {
176+
for (const prop of type_.properties) {
177+
query.push(prop)
178+
}
179+
}
180+
}
181+
}
164182
} else {
165183
if (definition.properties.length > 0) {
166184
query.push(...definition.properties)
167185
}
168186
}
169187

170-
if (Array.isArray(definition.inherits)) {
171-
const inherits = definition.inherits.map(inherit => getDefinition(inherit.type))
172-
for (const inherit of inherits) {
173-
const properties = getProperties(inherit)
174-
if (properties.path.length > 0) {
175-
path.push(...properties.path)
176-
}
177-
178-
if (properties.query.length > 0) {
179-
query.push(...properties.query)
180-
}
181-
182-
if (properties.body === Body.yesBody) {
183-
body = properties.body
184-
}
185-
}
186-
}
187-
188188
return { path, query, body }
189189
}
190190
}

output/openapi/elasticsearch-openapi.json

Lines changed: 358 additions & 181 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)