docusaurus-plugin-openapi-docs
Version:
OpenAPI plugin for Docusaurus.
33 lines (29 loc) • 798 B
text/typescript
/* ============================================================================
* Copyright (c) Palo Alto Networks
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* ========================================================================== */
import { create } from "./utils";
import { MediaTypeObject } from "../openapi/types";
interface Props {
style?: any;
title: string;
body: {
content?: {
[key: string]: MediaTypeObject;
};
description?: string;
required?: string[] | boolean;
};
}
export function createResponseSchema({ title, body, ...rest }: Props) {
return [
create("ResponseSchema", {
title: title,
body: body,
...rest,
}),
"\n\n",
];
}