Skip to content

Commit

Permalink
Merge branch 'main' into api-examples-pt7
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl authored Dec 9, 2024
2 parents bb2736e + d9bf86f commit d15f0f5
Show file tree
Hide file tree
Showing 96 changed files with 1,470 additions and 859 deletions.
36 changes: 18 additions & 18 deletions compiler/src/steps/validate-rest-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,30 +161,30 @@ export default async function validateRestSpec (model: model.Model, jsonSpec: Ma
if (definition.body.kind !== 'no_body') {
body = Body.yesBody
}

if (definition.attachedBehaviors != null) {
for (const attachedBehavior of definition.attachedBehaviors) {
const type_ = getDefinition({
namespace: '_spec_utils',
name: attachedBehavior
})
if (
type_.kind === 'interface' &&
// allowing CommonQueryParameters too generates many errors
attachedBehavior === 'CommonCatQueryParameters'
) {
for (const prop of type_.properties) {
query.push(prop)
}
}
}
}
} else {
if (definition.properties.length > 0) {
query.push(...definition.properties)
}
}

if (Array.isArray(definition.inherits)) {
const inherits = definition.inherits.map(inherit => getDefinition(inherit.type))
for (const inherit of inherits) {
const properties = getProperties(inherit)
if (properties.path.length > 0) {
path.push(...properties.path)
}

if (properties.query.length > 0) {
query.push(...properties.query)
}

if (properties.body === Body.yesBody) {
body = properties.body
}
}
}

return { path, query, body }
}
}
539 changes: 358 additions & 181 deletions output/openapi/elasticsearch-openapi.json

Large diffs are not rendered by default.

Loading

0 comments on commit d15f0f5

Please sign in to comment.