openapi: 3.1.0
info:
  title: api-service-memories
  contact: {}
  license:
    name: MIT License
    url: https://opensource.org/licenses/MIT
  version: "3.4"
servers:
- url: http://localhost:65503
  description: Generated server url
tags:
- name: Audio
  description: Audio search and file operations
- name: Texts
  description: Text search and file operations
- name: Films
  description: Film search operations
- name: Photos
  description: Photo search and file operations
- name: Publications
  description: Publication search and file operations
paths:
  /{municipalityId}/texts:
    get:
      tags:
      - Texts
      summary: Search texts
      description: "Fulltext search across title, comment and OCR text; only published\
        \ texts are returned. XMLTEXT and mediaFiles are excluded from the list response."
      operationId: searchTexts
      parameters:
      - name: municipalityId
        in: path
        required: true
        schema:
          type: string
      - name: parameters
        in: query
        required: true
        schema:
          $ref: "#/components/schemas/TextParameters"
      responses:
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PagedTextResponse"
  /{municipalityId}/texts/{id}:
    get:
      tags:
      - Texts
      summary: Get text by ID
      description: "Get a specific text by its ID, including the full XMLTEXT content\
        \ and any extra media files (TEXT_MULTI)"
      operationId: getText
      parameters:
      - name: municipalityId
        in: path
        required: true
        schema:
          type: string
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int32
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Text"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/texts/{id}/media/{mediaId}/file:
    get:
      tags:
      - Texts
      summary: Get text media file
      description: "Get an extra media file (TEXT_MULTI) attached to a text by specifying\
        \ the media file id and the variant (thumbnail, large, original). Returned\
        \ inline so browsers render it directly; Content-Type is derived from the\
        \ filename extension."
      operationId: getTextMediaFile
      parameters:
      - name: municipalityId
        in: path
        required: true
        schema:
          type: string
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int32
      - name: mediaId
        in: path
        required: true
        schema:
          type: integer
          format: int32
      - name: variant
        in: query
        required: true
        schema:
          type: string
      responses:
        "200":
          description: Successful operation
          content:
            '*/*': {}
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/texts/{id}/file:
    get:
      tags:
      - Texts
      summary: Get text file
      description: "Get a file associated with a text by specifying the variant (thumbnail,\
        \ large, text). Returned inline so browsers render it directly; Content-Type\
        \ is derived from the filename extension for thumbnail/large, and is text/html\
        \ for the text variant when the source is XML."
      operationId: getTextFile
      parameters:
      - name: municipalityId
        in: path
        required: true
        schema:
          type: string
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int32
      - name: variant
        in: query
        required: true
        schema:
          type: string
      responses:
        "200":
          description: Successful operation
          content:
            '*/*': {}
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/publications:
    get:
      tags:
      - Publications
      summary: Search publications
      description: "Fulltext search across title, comment and OCR text; only published\
        \ publications are returned. XMLTEXT is excluded from the list response."
      operationId: searchPublications
      parameters:
      - name: municipalityId
        in: path
        required: true
        schema:
          type: string
      - name: parameters
        in: query
        required: true
        schema:
          $ref: "#/components/schemas/PublicationParameters"
      responses:
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PagedPublicationResponse"
  /{municipalityId}/publications/{id}:
    get:
      tags:
      - Publications
      summary: Get publication by ID
      description: "Get a specific publication by its ID, including the full XMLTEXT\
        \ OCR content"
      operationId: getPublication
      parameters:
      - name: municipalityId
        in: path
        required: true
        schema:
          type: string
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int32
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Publication"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/publications/{id}/file:
    get:
      tags:
      - Publications
      summary: Get publication file
      description: "Get a file associated with a publication by specifying the variant\
        \ (thumbnail = thumbnail preview, large = large image, text = OCR/text content\
        \ transformed to HTML for inline browser display). Returned inline so browsers\
        \ render it directly; Content-Type is derived from the filename extension\
        \ for thumbnail/large, and is always text/html for text."
      operationId: getPublicationFile
      parameters:
      - name: municipalityId
        in: path
        required: true
        schema:
          type: string
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int32
      - name: variant
        in: query
        required: true
        schema:
          type: string
      responses:
        "200":
          description: Successful operation
          content:
            '*/*': {}
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/photos:
    get:
      tags:
      - Photos
      summary: Search photos
      description: Fulltext search across title and comment; only published photos
        are returned.
      operationId: searchPhotos
      parameters:
      - name: municipalityId
        in: path
        required: true
        schema:
          type: string
      - name: parameters
        in: query
        required: true
        schema:
          $ref: "#/components/schemas/PhotoParameters"
      responses:
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PagedPhotoResponse"
  /{municipalityId}/photos/{id}:
    get:
      tags:
      - Photos
      summary: Get photo by ID
      description: Get a specific photo by its ID
      operationId: getPhoto
      parameters:
      - name: municipalityId
        in: path
        required: true
        schema:
          type: string
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int32
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Photo"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/photos/{id}/file:
    get:
      tags:
      - Photos
      summary: Get photo file
      description: "Get a file associated with a photo by specifying the variant (thumbnail\
        \ = thumbnail preview, large = large image). Returned inline so browsers render\
        \ it directly; Content-Type is derived from the filename extension."
      operationId: getPhotoFile
      parameters:
      - name: municipalityId
        in: path
        required: true
        schema:
          type: string
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int32
      - name: variant
        in: query
        required: true
        schema:
          type: string
      responses:
        "200":
          description: Successful operation
          content:
            '*/*': {}
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/films:
    get:
      tags:
      - Films
      summary: Search films
      description: Search films by free text query across title and comment. Returns
        paginated results.
      operationId: searchFilms
      parameters:
      - name: municipalityId
        in: path
        required: true
        schema:
          type: string
      - name: parameters
        in: query
        required: true
        schema:
          $ref: "#/components/schemas/FilmParameters"
      responses:
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PagedFilmResponse"
  /{municipalityId}/films/{id}:
    get:
      tags:
      - Films
      summary: Get film by ID
      description: Get a specific film by its ID
      operationId: getFilm
      parameters:
      - name: municipalityId
        in: path
        required: true
        schema:
          type: string
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int32
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Film"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/films/{id}/stream:
    get:
      tags:
      - Films
      summary: Stream film for inline playback
      description: "Serves the film file with Content-Disposition: inline and Accept-Ranges:\
        \ bytes. Honours the Range request header to return 206 Partial Content for\
        \ browser seek support. Multi-range requests fall back to a 200 full-body\
        \ response."
      operationId: streamFilm
      parameters:
      - name: municipalityId
        in: path
        required: true
        schema:
          type: string
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int32
      - name: Range
        in: header
        required: false
        schema:
          type: string
      responses:
        "200":
          description: Successful operation
          content:
            application/octet-stream: {}
        "206":
          description: Partial content
          content:
            application/octet-stream: {}
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "416":
          description: Range not satisfiable
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/films/{id}/file:
    get:
      tags:
      - Films
      summary: Get film file
      description: Download the file associated with a film
      operationId: getFilmFile
      parameters:
      - name: municipalityId
        in: path
        required: true
        schema:
          type: string
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int32
      responses:
        "200":
          description: Successful operation
          content:
            application/octet-stream: {}
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/audios:
    get:
      tags:
      - Audio
      summary: Search audio
      description: Search audio by free text query across title and comment. Returns
        paginated results.
      operationId: searchAudios
      parameters:
      - name: municipalityId
        in: path
        required: true
        schema:
          type: string
      - name: parameters
        in: query
        required: true
        schema:
          $ref: "#/components/schemas/AudioParameters"
      responses:
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PagedAudioResponse"
  /{municipalityId}/audios/{id}:
    get:
      tags:
      - Audio
      summary: Get audio by ID
      description: Get a specific audio record by its ID
      operationId: getAudio
      parameters:
      - name: municipalityId
        in: path
        required: true
        schema:
          type: string
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int32
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Audio"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/audios/{id}/stream:
    get:
      tags:
      - Audio
      summary: Stream audio for inline playback
      description: "Serves the audio file with Content-Disposition: inline and Accept-Ranges:\
        \ bytes. Honours the Range request header to return 206 Partial Content for\
        \ browser seek support. Multi-range requests fall back to a 200 full-body\
        \ response."
      operationId: streamAudio
      parameters:
      - name: municipalityId
        in: path
        required: true
        schema:
          type: string
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int32
      - name: Range
        in: header
        required: false
        schema:
          type: string
      responses:
        "200":
          description: Successful operation
          content:
            application/octet-stream: {}
        "206":
          description: Partial content
          content:
            application/octet-stream: {}
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "416":
          description: Range not satisfiable
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/audios/{id}/file:
    get:
      tags:
      - Audio
      summary: Get audio file
      description: Download the file associated with an audio record
      operationId: getAudioFile
      parameters:
      - name: municipalityId
        in: path
        required: true
        schema:
          type: string
      - name: id
        in: path
        required: true
        schema:
          type: integer
          format: int32
      responses:
        "200":
          description: Successful operation
          content:
            application/octet-stream: {}
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /api-docs:
    get:
      tags:
      - API
      summary: OpenAPI
      operationId: getApiDocs
      responses:
        "200":
          description: OK
          content:
            application/yaml:
              schema:
                type: string
      x-auth-type: None
      x-throttling-tier: Unlimited
      x-wso2-mutual-ssl: Optional
components:
  schemas:
    Direction:
      type: string
      enum:
      - ASC
      - DESC
    TextParameters:
      type: object
      description: Text search parameters
      properties:
        page:
          type: integer
          format: int32
          default: 1
          description: Page number
          examples:
          - 1
          minimum: 1
        limit:
          type: integer
          format: int32
          description: Result size per page. Maximum allowed value is dynamically
            configured
          examples:
          - 15
          minimum: 1
        sortBy:
          type: array
          items:
            type: string
            description: The properties to sort on
            examples:
            - propertyName
        sortDirection:
          $ref: "#/components/schemas/Direction"
          description: The sort order direction
          examples:
          - ASC
        query:
          type: string
          description: Free text search query
          examples:
          - Stadshuset
    Problem:
      type: object
      properties:
        detail:
          type: string
        title:
          type: string
        instance:
          type: string
          format: uri
        type:
          type: string
          format: uri
        status:
          type: integer
          format: int32
    ConstraintViolationProblem:
      type: object
      properties:
        type:
          type: string
          format: uri
        status:
          type: integer
          format: int32
        violations:
          type: array
          items:
            $ref: "#/components/schemas/Violation"
        title:
          type: string
        detail:
          type: string
        causeAsProblem:
          $ref: "#/components/schemas/ThrowableProblem"
        instance:
          type: string
          format: uri
    ThrowableProblem:
      type: object
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
          format: int32
        detail:
          type: string
        instance:
          type: string
          format: uri
        causeAsProblem: {}
    Violation:
      type: object
      properties:
        field:
          type: string
        message:
          type: string
    PagedTextResponse:
      type: object
      description: Paged text response
      properties:
        texts:
          type: array
          items:
            $ref: "#/components/schemas/Text"
            readOnly: true
        _meta:
          $ref: "#/components/schemas/PagingAndSortingMetaData"
          readOnly: true
    PagingAndSortingMetaData:
      type: object
      description: PagingAndSortingMetaData model
      properties:
        page:
          type: integer
          format: int32
          description: Current page
          examples:
          - 5
          readOnly: true
        limit:
          type: integer
          format: int32
          description: Displayed objects per page
          examples:
          - 20
          readOnly: true
        count:
          type: integer
          format: int32
          description: Displayed objects on current page
          examples:
          - 13
          readOnly: true
        totalRecords:
          type: integer
          format: int64
          description: Total amount of hits based on provided search parameters
          examples:
          - 98
          readOnly: true
        totalPages:
          type: integer
          format: int32
          description: Total amount of pages based on provided search parameters
          examples:
          - 23
          readOnly: true
        sortBy:
          type: array
          items:
            type: string
            description: The properties to sort by
            examples:
            - property
            readOnly: true
        sortDirection:
          $ref: "#/components/schemas/Direction"
          description: The sort order direction
          examples:
          - ASC
    Text:
      type: object
      description: Text model
      properties:
        textId:
          type: integer
          format: int32
          description: Text ID
          examples:
          - 1001
        filename:
          type: string
          description: Original filename from archive
          examples:
          - minne_1920.xml
        documentDate:
          type: string
          description: Document start date
          examples:
          - 1920-01-01
        documentEndDate:
          type: string
          description: Document end date (for date ranges)
          examples:
          - 1920-12-31
        documentTitle:
          type: string
          description: Document title
          examples:
          - Minne från Sundsvall 1920
        locationText:
          type: string
          description: Document location (free-text fallback from D_OPLATS)
          examples:
          - Sundsvall
        location:
          type: string
          description: Resolved place name from TOPOGRAFI (preferred over locationText
            when set)
          examples:
          - Sundsvall
        subjectId:
          type: integer
          format: int32
          description: OCM subject ID (D_O_ID)
          examples:
          - 20
        subject:
          type: string
          description: Resolved subject label from OCM (Ämne)
          examples:
          - Musik
        comment:
          type: string
          description: Comment / description
          examples:
          - Memoir transcribed from handwritten notes
        thumbnailFilename:
          type: string
          description: Thumbnail file name
          examples:
          - TEXT.id_1001_fil_liten.jpeg
        largeImageFilename:
          type: string
          description: Large image file name
          examples:
          - TEXT.id_1001_fil_stor.jpeg
        ocrFilename:
          type: string
          description: OCR/text file name
          examples:
          - TEXT.id_1001_fil_txt.xml
        xmltext:
          type: string
          description: Full OCR/XML text (only returned on detail lookup)
        mediaFiles:
          type: array
          description: Extra media files associated with this text (only returned
            on detail lookup)
          items:
            $ref: "#/components/schemas/TextMediaFile"
    TextMediaFile:
      type: object
      description: Extra media file attached to a text (TEXT_MULTI)
      properties:
        id:
          type: integer
          format: int32
          description: "Media file ID (per-text sequence number, MIID)"
          examples:
          - 1
        thumbnailFilename:
          type: string
          description: Thumbnail file name
          examples:
          - TEXT.id_1001.multi_1.fil_liten.jpeg
        largeImageFilename:
          type: string
          description: Large image file name
          examples:
          - TEXT.id_1001.multi_1.fil_stor.jpeg
        originalFilename:
          type: string
          description: Original file name
          examples:
          - TEXT.id_1001.multi_1.fil_original.jpeg
    PublicationParameters:
      type: object
      description: Publication search parameters
      properties:
        page:
          type: integer
          format: int32
          default: 1
          description: Page number
          examples:
          - 1
          minimum: 1
        limit:
          type: integer
          format: int32
          description: Result size per page. Maximum allowed value is dynamically
            configured
          examples:
          - 15
          minimum: 1
        sortBy:
          type: array
          items:
            type: string
            description: The properties to sort on
            examples:
            - propertyName
        sortDirection:
          $ref: "#/components/schemas/Direction"
          description: The sort order direction
          examples:
          - ASC
        query:
          type: string
          description: Free text search query
          examples:
          - Drowning accident
    PagedPublicationResponse:
      type: object
      description: Paged publication response
      properties:
        publications:
          type: array
          items:
            $ref: "#/components/schemas/Publication"
            readOnly: true
        _meta:
          $ref: "#/components/schemas/PagingAndSortingMetaData"
          readOnly: true
    Publication:
      type: object
      description: Publication model
      properties:
        publicationId:
          type: integer
          format: int32
          description: Publication ID
          examples:
          - 207
        filename:
          type: string
          description: Original filename from archive
          examples:
          - F21051/1841-02-18_Alfwar och Skämt nr 8.xml
        publicationType:
          type: string
          description: Publication type (denormalized PUBLIKTYP value)
          examples:
          - Tidning
        date:
          type: string
          description: Publication date
          examples:
          - 1841-02-18
        periodicalTitle:
          type: string
          description: Periodical title (newspaper/magazine name)
          examples:
          - Alfwar och Skämt
        issueNumber:
          type: string
          description: Periodical issue number
          examples:
          - "8"
        pageNumber:
          type: string
          description: Periodical page number
          examples:
          - "3"
        publisherLocation:
          type: string
          description: Publisher location
          examples:
          - Sundsvall
        documentTitle:
          type: string
          description: Document title
          examples:
          - Page 3 Alfwar och Skämt nr 8 1841
        locationText:
          type: string
          description: Publication location (free-text fallback from P_OPLATS)
          examples:
          - Sundsvall
        location:
          type: string
          description: Resolved place name from TOPOGRAFI (via P_T_ID; preferred over
            locationText when set)
          examples:
          - Sundsvall
        comment:
          type: string
          description: Comment / description
          examples:
          - Newspaper issue from 1841
        thumbnailFilename:
          type: string
          description: Thumbnail file name
          examples:
          - PUBL.id_207_fil_liten.jpeg
        largeImageFilename:
          type: string
          description: Large image file name
          examples:
          - PUBL.id_207_fil_stor.jpeg
        ocrFilename:
          type: string
          description: OCR/text file name
          examples:
          - PUBL.id_207_fil_txt.xml
        xmltext:
          type: string
          description: Full OCR/XML text (only returned on detail lookup)
    PhotoParameters:
      type: object
      description: Photo search parameters
      properties:
        page:
          type: integer
          format: int32
          default: 1
          description: Page number
          examples:
          - 1
          minimum: 1
        limit:
          type: integer
          format: int32
          description: Result size per page. Maximum allowed value is dynamically
            configured
          examples:
          - 15
          minimum: 1
        sortBy:
          type: array
          items:
            type: string
            description: The properties to sort on
            examples:
            - propertyName
        sortDirection:
          $ref: "#/components/schemas/Direction"
          description: The sort order direction
          examples:
          - ASC
        query:
          type: string
          description: Free text search query
          examples:
          - Sundsvall
        objectType:
          type: string
          description: Filter by object type. Use 'Foto' for photographs or 'Föremål'
            for physical objects. Omit to return both.
          examples:
          - Foto
    PagedPhotoResponse:
      type: object
      description: Paged photo response
      properties:
        photos:
          type: array
          items:
            $ref: "#/components/schemas/Photo"
            readOnly: true
        _meta:
          $ref: "#/components/schemas/PagingAndSortingMetaData"
          readOnly: true
    Photo:
      type: object
      description: Photo model
      properties:
        photoId:
          type: integer
          format: int32
          description: Photo ID
          examples:
          - 1234
        filename:
          type: string
          description: Original filename from archive
        accessionNumber:
          type: string
          description: Accession number
        referenceCode:
          type: string
          description: Reference code (negative number)
        inventoryNumber:
          type: string
          description: Inventory number (RAÄ-nr)
        earlierReference:
          type: string
          description: Earlier reference number
        documentTitle:
          type: string
          description: Document title / description
        subjectKeyword:
          type: string
          description: Subject keyword
        comment:
          type: string
          description: Comment / description
        earliest:
          type: string
          description: Earliest date of time period
          examples:
          - "1920"
        latest:
          type: string
          description: Latest date of time period
          examples:
          - "1925"
        observationDate:
          type: string
          description: Observation date
        locationText:
          type: string
          description: Indeterminable place (free-text fallback from F_OPLATS)
        location:
          type: string
          description: Resolved place name from TOPOGRAFI (preferred over locationText
            when set)
        storageLocation:
          type: string
          description: Storage location
        objectType:
          type: string
          description: Object type
          examples:
          - Foto
        colorMode:
          type: string
          description: Black & white / colour
        negativePositive:
          type: string
          description: Negative / positive
        transmissiveReflective:
          type: string
          description: Transmissive / reflective
        imageCarrier:
          type: string
          description: Image carrier
        material:
          type: string
          description: Material
        technique:
          type: string
          description: Technique
        function:
          type: string
          description: Function
        height:
          type: string
          description: Height (cm)
        width:
          type: string
          description: Width (cm)
        diameter:
          type: string
          description: Diameter
        framed:
          type: string
          description: Framed / mounted
        conditionCategory:
          type: string
          description: Condition category
        conditionAssessment:
          type: string
          description: Condition assessment
        observerName:
          type: string
          description: Observer name
        treatment:
          type: string
          description: Treatment / action taken
        treatmentDate:
          type: string
          description: Treatment date
        signature:
          type: string
          description: Signature
        rights:
          type: string
          description: Image rights
        restricted:
          type: string
          description: Restrictions (Yes/No)
        restrictionNote:
          type: string
          description: Restriction comment
        provenance:
          type: string
          description: Comment about creator/donor
        thumbnailFilename:
          type: string
          description: Thumbnail file name
        largeImageFilename:
          type: string
          description: Large image file name
        relatedPhotoIds:
          type: array
          description: IDs of related photos via FOTO_FOTO (only returned on detail
            lookup)
          items:
            type: integer
            format: int32
        subjects:
          type: array
          description: Subjects / ämnesklassificering via FOTO_OCM (only returned
            on detail lookup)
          items:
            $ref: "#/components/schemas/Subject"
    Subject:
      type: object
      description: Subject / Ämne (OCM)
      properties:
        code:
          type: string
          description: Subject code (OCMKOD)
          examples:
          - ALM
        text:
          type: string
          description: Subject label (OCMTEXT)
          examples:
          - Allmänt
        description:
          type: string
          description: Subject description (OCMDESC)
          examples:
          - Allmänt ämne
    FilmParameters:
      type: object
      description: Film search parameters
      properties:
        page:
          type: integer
          format: int32
          default: 1
          description: Page number
          examples:
          - 1
          minimum: 1
        limit:
          type: integer
          format: int32
          description: Result size per page. Maximum allowed value is dynamically
            configured
          examples:
          - 15
          minimum: 1
        sortBy:
          type: array
          items:
            type: string
            description: The properties to sort on
            examples:
            - propertyName
        sortDirection:
          $ref: "#/components/schemas/Direction"
          description: The sort order direction
          examples:
          - ASC
        query:
          type: string
          description: Free text search query
          examples:
          - midsummer
    Film:
      type: object
      description: Film model
      properties:
        filmId:
          type: integer
          format: int32
          description: Film ID
          examples:
          - 123
        filename:
          type: string
          description: Filename
          examples:
          - film001.mp4
        objectFilePath:
          type: string
          description: Film object file path
          examples:
          - /path/to/file.mp4
        objectType:
          type: string
          description: Object type
          examples:
          - VIDEO
        date:
          type: string
          description: Date
          examples:
          - 1985-06-15
        documentTitle:
          type: string
          description: Document title
          examples:
          - Midsummer celebration in Sundsvall
        topographyId:
          type: integer
          format: int32
          description: Topography ID
          examples:
          - 1
        locationText:
          type: string
          description: Film location (free-text fallback from FILM_OPLATS)
          examples:
          - Sundsvall
        location:
          type: string
          description: Resolved place name from TOPOGRAFI (preferred over locationText
            when set)
          examples:
          - Sundsvall
        organizationId:
          type: integer
          format: int32
          description: Film organization ID
          examples:
          - 1
        subEntityId:
          type: integer
          format: int32
          description: Film sub-entity ID
          examples:
          - 0
        unitId:
          type: integer
          format: int32
          description: Film unit ID
          examples:
          - 1
        comment:
          type: string
          description: Comment
          examples:
          - A film about midsummer celebrations
        filmMimeType:
          type: string
          description: MIME type
          examples:
          - video/mp4
        nodeId:
          type: integer
          format: int32
          description: Node ID
          examples:
          - 456
        options:
          type: integer
          format: int32
          description: Options
          examples:
          - 0
        deletedDate:
          type: string
          format: date
          description: Deleted date
          examples:
          - 2026-01-15
    PagedFilmResponse:
      type: object
      description: Paged film response
      properties:
        films:
          type: array
          items:
            $ref: "#/components/schemas/Film"
            readOnly: true
        _meta:
          $ref: "#/components/schemas/PagingAndSortingMetaData"
          readOnly: true
    AudioParameters:
      type: object
      description: Audio search parameters
      properties:
        page:
          type: integer
          format: int32
          default: 1
          description: Page number
          examples:
          - 1
          minimum: 1
        limit:
          type: integer
          format: int32
          description: Result size per page. Maximum allowed value is dynamically
            configured
          examples:
          - 15
          minimum: 1
        sortBy:
          type: array
          items:
            type: string
            description: The properties to sort on
            examples:
            - propertyName
        sortDirection:
          $ref: "#/components/schemas/Direction"
          description: The sort order direction
          examples:
          - ASC
        query:
          type: string
          description: Free text search query
          examples:
          - interview
    Audio:
      type: object
      description: Audio model
      properties:
        audioId:
          type: integer
          format: int32
          description: Audio ID
          examples:
          - 123
        filename:
          type: string
          description: Filename
          examples:
          - interview1980.mp3
        objectFilePath:
          type: string
          description: Audio object file path
          examples:
          - /path/to/file.mp3
        objectType:
          type: string
          description: Object type
          examples:
          - LJUD
        date:
          type: string
          description: Date
          examples:
          - 1980-04-12
        documentTitle:
          type: string
          description: Document title
          examples:
          - Interview with the mayor
        topographyId:
          type: integer
          format: int32
          description: Topography ID
          examples:
          - 1
        locationText:
          type: string
          description: Audio location (free-text fallback from LJUD_OPLATS)
          examples:
          - Sundsvall
        location:
          type: string
          description: Resolved place name from TOPOGRAFI (preferred over locationText
            when set)
          examples:
          - Sundsvall
        subjectId:
          type: integer
          format: int32
          description: OCM subject ID
          examples:
          - 1
        subject:
          type: string
          description: Resolved subject label from OCM (Ämne)
          examples:
          - Intervju
        authorPersonId:
          type: integer
          format: int32
          description: Author (individual person) ID
          examples:
          - 0
        authorEntityId:
          type: integer
          format: int32
          description: Author (legal entity) ID
          examples:
          - 1
        comment:
          type: string
          description: Comment
          examples:
          - Audio recording of an interview
        audioMimeType:
          type: string
          description: MIME type
          examples:
          - audio/mpeg
        nodeId:
          type: integer
          format: int32
          description: Node ID
          examples:
          - 456
        options:
          type: integer
          format: int32
          description: Options
          examples:
          - 0
        deletedDate:
          type: string
          format: date
          description: Deleted date
          examples:
          - 2026-01-15
    PagedAudioResponse:
      type: object
      description: Paged audio response
      properties:
        audios:
          type: array
          items:
            $ref: "#/components/schemas/Audio"
            readOnly: true
        _meta:
          $ref: "#/components/schemas/PagingAndSortingMetaData"
          readOnly: true
  securitySchemes: {}
