{
  "openapi": "3.1.0",
  "info": {
    "title": "Northgate fictional sample stock",
    "version": "1.0.0",
    "description": "Public concept showroom. All stock, prices and specifications are fictional. Public read-only sample inventory. Read-only, no purchase, finance, enquiry or booking actions."
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "paths": {
    "/api/stock": {
      "get": {
        "operationId": "listSampleVehicles",
        "summary": "Filter fictional sample cars",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fuel",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "body",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "maxPrice",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "minYear",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "price_asc",
                "price_desc",
                "mileage_asc",
                "year_desc"
              ],
              "default": "price_asc"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Inventory wrapper with stockVersion, sample:true, currency, count, vehicles and limitations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "stockVersion": {
                      "const": "northgate-sample-v1"
                    },
                    "sample": {
                      "const": true
                    },
                    "notice": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "vehicles": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SampleVehicle"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid filter or sort"
          }
        }
      }
    },
    "/api/stock/{id}": {
      "get": {
        "operationId": "getSampleVehicle",
        "summary": "Read one fictional sample car",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 11
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Vehicle wrapper with sample:true and stockVersion",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "stockVersion": {
                      "const": "northgate-sample-v1"
                    },
                    "sample": {
                      "const": true
                    },
                    "notice": {
                      "type": "string"
                    },
                    "vehicle": {
                      "$ref": "#/components/schemas/SampleVehicle"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Unknown sample car"
          }
        }
      }
    },
    "/cars/{id}": {
      "get": {
        "operationId": "getSampleVehiclePage",
        "summary": "Read HTML car details and structured Car data",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fictional sample HTML detail"
          },
          "404": {
            "description": "Unknown sample car"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SampleVehicle": {
        "type": "object",
        "required": [
          "id",
          "name",
          "price",
          "sample",
          "availability"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "fuel": {
            "type": "string"
          },
          "year": {
            "type": "integer"
          },
          "mileage": {
            "type": "object",
            "properties": {
              "value": {
                "type": "integer"
              },
              "unit": {
                "const": "mi"
              }
            }
          },
          "price": {
            "type": "object",
            "properties": {
              "value": {
                "type": "integer"
              },
              "currency": {
                "const": "GBP"
              },
              "type": {
                "const": "fictional_sample"
              }
            }
          },
          "description": {
            "type": "string"
          },
          "sample": {
            "const": true
          },
          "availability": {
            "const": "sample_only"
          },
          "detailsUrl": {
            "type": "string"
          },
          "apiUrl": {
            "type": "string"
          }
        }
      }
    }
  }
}