open-api icon indicating copy to clipboard operation
open-api copied to clipboard

OpenAPI Types package, Path Item Object

Open dbwodlf3 opened this issue 1 year ago • 1 comments

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",

dbwodlf3 avatar Jul 05 '23 02:07 dbwodlf3