{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/jenriks-com/json-schema/jenriks-com-photo-search-result-schema.json",
  "title": "PhotoSearchResult",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/jenriks-com-openapi.json#/components/schemas/PhotoSearchResult",
  "type": "object",
  "required": [
    "total_matches",
    "offset",
    "returned",
    "photos",
    "has_more",
    "next_cursor"
  ],
  "properties": {
    "total_matches": {
      "type": "integer",
      "minimum": 0
    },
    "offset": {
      "description": "Offset of the first returned row; 0 when a cursor was used",
      "type": "integer",
      "minimum": 0
    },
    "returned": {
      "type": "integer",
      "minimum": 0
    },
    "photos": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Photo"
      }
    },
    "next_offset": {
      "description": "Kept for offset paging; present when more matches exist",
      "type": "integer"
    },
    "has_more": {
      "description": "True when another page exists",
      "type": "boolean"
    },
    "next_cursor": {
      "description": "Opaque token for the next page; null on the last page. Send it back as cursor.",
      "type": [
        "string",
        "null"
      ]
    },
    "cursor": {
      "description": "Echo of the cursor this page was fetched with, when one was sent",
      "type": "string"
    },
    "links": {
      "type": "object",
      "required": [
        "self"
      ],
      "properties": {
        "self": {
          "description": "This request",
          "type": "string",
          "format": "uri"
        },
        "next": {
          "description": "The same request with cursor=next_cursor and no offset; null on the last page",
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        }
      }
    }
  },
  "$defs": {
    "Photo": {
      "type": "object",
      "required": [
        "title",
        "photographer",
        "date",
        "url",
        "categories",
        "tags",
        "image",
        "credit"
      ],
      "properties": {
        "title": {
          "type": "string"
        },
        "photographer": {
          "type": "string",
          "enum": [
            "Erik",
            "Jens"
          ]
        },
        "date": {
          "description": "Publication date, YYYY-MM-DD",
          "type": "string",
          "format": "date"
        },
        "url": {
          "description": "Permanent page URL",
          "type": "string",
          "format": "uri"
        },
        "location": {
          "type": [
            "string",
            "null"
          ],
          "description": "City and country when known"
        },
        "categories": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "image": {
          "$ref": "#/$defs/PhotoImage"
        },
        "credit": {
          "description": "Ready-made credit line: photographer, JENRIKS, page URL",
          "type": "string"
        },
        "camera": {
          "type": [
            "string",
            "null"
          ],
          "description": "Camera the photo was taken with, when the file carries it"
        },
        "lens": {
          "type": [
            "string",
            "null"
          ],
          "description": "Lens the photo was taken with, when the file carries it"
        },
        "geo": {
          "type": [
            "object",
            "null"
          ],
          "description": "WGS 84 coordinates of the location when the post carries them, otherwise null",
          "required": [
            "latitude",
            "longitude"
          ],
          "properties": {
            "latitude": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "longitude": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          }
        }
      }
    },
    "PhotoImage": {
      "type": "object",
      "required": [
        "full"
      ],
      "properties": {
        "full": {
          "description": "1600 px long edge",
          "type": "string",
          "format": "uri"
        },
        "thumbnail": {
          "description": "400 px long edge",
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        }
      }
    }
  }
}