(
schema: SchemaObject | ReferenceObject,
options: Partial<RequestBodyObject> = {},
mediaType = 'application/json',
)
| 17 | * @param mediaType - Optional media type, default to `application/json` |
| 18 | */ |
| 19 | export function aBodySpec( |
| 20 | schema: SchemaObject | ReferenceObject, |
| 21 | options: Partial<RequestBodyObject> = {}, |
| 22 | mediaType = 'application/json', |
| 23 | ): RequestBodyObject { |
| 24 | const spec = Object.assign({}, options); |
| 25 | spec.content = spec.content ?? {}; |
| 26 | Object.assign(spec.content, { |
| 27 | [mediaType]: { |
| 28 | schema: schema, |
| 29 | }, |
| 30 | }); |
| 31 | return spec as RequestBodyObject; |
| 32 | } |
| 33 | |
| 34 | export function aRestServerConfig( |
| 35 | customConfig?: RestServerConfig, |
no outgoing calls
no test coverage detected