{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/stayportland-com/json-schema/stayportland-com-search-request-schema.json",
  "title": "SearchRequest",
  "description": "Search public rentals with an optional date pair. Unknown fields are rejected. Date pairs are checked at runtime against the current Portland date and the 30-night maximum.",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/stayportland-com-openapi.json#/components/schemas/SearchRequest",
  "type": "object",
  "properties": {
    "checkin": {
      "type": "string",
      "maxLength": 10,
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "Arrival date (YYYY-MM-DD), today or later in America/Los_Angeles. Provide checkout together with checkin.",
      "format": "date"
    },
    "checkout": {
      "type": "string",
      "maxLength": 10,
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "Departure date (YYYY-MM-DD), after checkin, for a stay of 1 to 30 nights.",
      "format": "date"
    },
    "guests": {
      "type": "integer",
      "minimum": 1,
      "maximum": 16,
      "description": "Total number of guests, including children."
    },
    "bedrooms": {
      "type": "integer",
      "minimum": 0,
      "maximum": 8,
      "description": "Minimum bedrooms; 0 includes studios."
    },
    "bathrooms": {
      "type": "integer",
      "minimum": 0,
      "maximum": 12,
      "description": "Minimum bathrooms."
    },
    "beds": {
      "type": "integer",
      "minimum": 0,
      "maximum": 24,
      "description": "Minimum beds."
    },
    "pets": {
      "type": "boolean",
      "description": "Filter for pet-friendly homes when true."
    },
    "neighborhood": {
      "type": "string",
      "maxLength": 200,
      "description": "Portland neighborhood filter."
    },
    "q": {
      "description": "Public feature, neighborhood, or listing-copy criteria.",
      "type": "string",
      "maxLength": 200
    },
    "maxNightly": {
      "type": "number",
      "exclusiveMinimum": 0,
      "maximum": 10000,
      "description": "Maximum indicative nightly price in USD; use a live quote for the all-in stay total."
    },
    "sort": {
      "type": "string",
      "enum": [
        "recommended",
        "price_low",
        "price_high",
        "rating",
        "capacity_fit"
      ],
      "description": "Result ordering. Defaults to recommended. Priced search sorts the current page by exact total for price_low or price_high.",
      "default": "recommended"
    },
    "offset": {
      "type": "integer",
      "minimum": 0,
      "maximum": 300,
      "description": "Pagination offset; use nextOffset from the previous response.",
      "default": 0
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 20,
      "description": "Maximum results on the current page.",
      "default": 8
    }
  },
  "additionalProperties": false,
  "dependentRequired": {
    "checkin": [
      "checkout"
    ],
    "checkout": [
      "checkin"
    ]
  }
}