open-api
open-api copied to clipboard
OpenAPI Types package, Path Item Object
https://github.com/kogosoftwarellc/open-api/tree/main/packages/openapi-types#readme
export type PathItemObject = OpenAPIV3_1.PathItemObject<OperationObject>;
export const PathItemObject: PathItemObject = {
// $ref: null,
summary: "",
description: "",
servers: [],
parameters: [],
$ref: "",
};
export type OperationObject =
OpenAPIV3_1.OperationObject<OpenAPIV3.OperationObject>;
export const OperationObject: OperationObject = {
tags: [],
summary: "",
description: "",
externalDocs: {
url: "",
},
operationId: "",
parameters: [],
requestBody: {
content: {
"application/json": {
schema: {
type: "object",
properties: {},
},
},
},
},
responses: {
"200": {
description: "Success",
content: {},
},
},
callbacks: {},
deprecated: false,
security: [],
servers: [],
};
export type OperationObject2 =
OpenAPIV3_1.OperationObject;
export const OperationObject: OperationObject2 = {
tags: [],
summary: "",
description: "",
externalDocs: {
url: "",
},
operationId: "",
parameters: [],
requestBody: {
content: {
"application/json": {
schema: {
type: "object",
properties: {},
},
},
},
},
responses: {
"200": {
description: "Success",
content: {},
},
},
callbacks: {},
deprecated: false,
security: [],
servers: [],
};
// it works.
PathItemObject.get = OperationObject;
// it doesn't work.
PathItemObject.post = OperationObject2;
package version is "openapi-types": "^12.1.3",