{
  "openapi": "3.0.1",
  "info": {
    "title": "ProductsAPI",
    "version": "1.0"
  },
  "paths": {
    "/ProductCategories": {
      "get": {
        "tags": [
          "ProductCategories"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductCategory"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductCategory"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProductCategory"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ProductCategories"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductCategory"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductCategory"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductCategory"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategory"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategory"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategory"
                }
              }
            }
          }
        }
      }
    },
    "/ProductCategories/{id}": {
      "get": {
        "tags": [
          "ProductCategories"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategory"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategory"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategory"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "ProductCategories"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductCategory"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductCategory"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ProductCategory"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      },
      "delete": {
        "tags": [
          "ProductCategories"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Product": {
        "required": [
          "listPrice",
          "name",
          "productNumber",
          "size",
          "standardCost",
          "weight"
        ],
        "type": "object",
        "properties": {
          "productID": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "productNumber": {
            "minLength": 1,
            "type": "string"
          },
          "color": {
            "type": "string",
            "nullable": true
          },
          "standardCost": {
            "type": "number",
            "format": "double"
          },
          "listPrice": {
            "type": "number",
            "format": "double"
          },
          "size": {
            "type": "integer",
            "format": "int32"
          },
          "weight": {
            "type": "number",
            "format": "double"
          },
          "productCategoryID": {
            "type": "integer",
            "format": "int32"
          },
          "productCategory": {
            "$ref": "#/components/schemas/ProductCategory"
          }
        },
        "additionalProperties": false
      },
      "ProductCategory": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "productCategoryID": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "minLength": 1,
            "type": "string"
          },
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Product"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    }
  }
}