@@ -4,7 +4,7 @@ import type { ChildParamsGroup } from './types'
|
||||
|
||||
type Props = {
|
||||
slug: string
|
||||
childParamsGroups: ChildParamsGroup[]
|
||||
childParamsGroups?: ChildParamsGroup[]
|
||||
}
|
||||
|
||||
export function ChildBodyParametersRows({ slug, childParamsGroups }: Props) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -165,6 +165,9 @@ export default class Operation {
|
||||
|
||||
async renderBodyParameterDescriptions() {
|
||||
if (!this.#operation.requestBody) return []
|
||||
// There is currently only one operation with more than one content type
|
||||
// and the request body parameter types are the same for both.
|
||||
// Operation Id: markdown/render-raw
|
||||
const contentType = Object.keys(this.#operation.requestBody.content)[0]
|
||||
let bodyParamsObject = get(
|
||||
this.#operation,
|
||||
@@ -378,13 +381,17 @@ async function getBodyParams(paramsObject, requiredParams) {
|
||||
param.childParamsGroups.push(
|
||||
...flatten(
|
||||
childParamsGroup.params
|
||||
.filter((param) => param.childParamsGroups.length)
|
||||
.filter((param) => param.childParamsGroups?.length)
|
||||
.map((param) => param.childParamsGroups)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
return param
|
||||
const paramDecorated = { ...param }
|
||||
delete paramDecorated.items
|
||||
delete paramDecorated.rawDescription
|
||||
delete paramDecorated.rawType
|
||||
if (paramDecorated.childParamsGroups.length === 0) delete paramDecorated.childParamsGroups
|
||||
return paramDecorated
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user