emissary-ingress / emissary

open source Kubernetes-native API gateway for microservices built on the Envoy Proxy
https://www.getambassador.io
Apache License 2.0
4.37k stars 685 forks source link

devportal is not able to scrape API documentations #2956

Closed chris-ng-scmp closed 2 years ago

chris-ng-scmp commented 4 years ago

Describe the bug

My AES installation with a Mapping as following, the API accessible via the host masked.abc with the prefix masked.abc

Also the API documentation accessible via https://masked.abc/.ambassador-internal/openapi-docs too

apiVersion: getambassador.io/v2
kind: Mapping
metadata:
  name: uat-app-cwh-assets-v2
spec:
  ambassador_id: ambassador-aes-uat
  host: masked.abc
  method: GET|PUT|POST|DELETE|PATCH|OPTIONS
  method_regex: true
  prefix: /nexus-news-items/v2/
  retry_policy:
    num_retries: 5
    retry_on: 5xx
  service: uat-app-cwh-assets-v2
  timeout_ms: 120000

Meanwhile, the pod of the ambassador deployment returning following 404 error related to the scrapping log

1961:time="2020-09-01 04:10:03" level=error msg="HTTP error 404 from https://127.0.0.1:8443/nexus-news-items/v2/.ambassador-internal/openapi-docs" func=github.com/datawire/apro/cmd/amb-sidecar/devportal/server.HTTPGet file="github.com/datawire/apro/cmd/amb-sidecar/devportal/server/fetcher.go:202" subsystem=fetcher url="https://127.0.0.1:8443/nexus-news-items/v2/.ambassador-internal/openapi-docs"
1990:{"start_time": "2020-09-01T04:10:03.426Z","method": "GET","path": "/nexus-news-items/v2/.ambassador-internal/openapi-docs","protocol": "HTTP/1.1","response_code": "404","response_flags": "UAEX","bytes_received": "0","bytes_sent": "9","duration": "0","upstream_service_time": "-","x_forwarded_for": "10.200.4.105","user_agent": "Go-http-client/1.1","correlation_id": "-","authority": "uat-api.scmp.work","upstream_host": "-","upstream_cluster": "-","upstream_local_address": "-","downstream_local_address": "127.0.0.1:8443","downstream_remote_address": "127.0.0.1:42114","requested_server_name": "-","istio_policy_status": "-","upstream_transport_failure_reason": "-"}

So I guess the 404 caused by requesting the endpoint without host header host: masked.abc to match with mapping above, so I created another mapping without host property as following

apiVersion: getambassador.io/v2
kind: Mapping
metadata:
  name: uat-app-cwh-assets-v2-local
spec:
  ambassador_id: ambassador-aes-uat
  method: GET|PUT|POST|DELETE|PATCH|OPTIONS
  method_regex: true
  prefix: /nexus-news-items/v2-local/
  retry_policy:
    num_retries: 5
    retry_on: 5xx
  service: uat-app-cwh-assets-v2
  timeout_ms: 120000

With the mapping, I can get the API document via

kubectl exec -it deploy/ambassador-aes-uat -- curl -L "https://127.0.0.1:8443/nexus-news-items/v2-local/.ambassador-internal/openapi-docs" -k

But this is very strange the fetcher.go still getting 404 with the same URL under the pod...meanwhile the pod logged code 200 for my above curl command

2031:time="2020-09-01 03:55:03" level=error msg="HTTP error 404 from https://127.0.0.1:8443/nexus-news-items/v2-local/.ambassador-internal/openapi-docs" func=github.com/datawire/apro/cmd/amb-sidecar/devportal/server.HTTPGet file="github.com/datawire/apro/cmd/amb-sidecar/devportal/server/fetcher.go:202" subsystem=fetcher url="https://127.0.0.1:8443/nexus-news-items/v2-local/.ambassador-internal/openapi-docs"
2068:{"start_time": "2020-09-01T03:55:03.512Z","method": "GET","path": "/nexus-news-items/v2-local/.ambassador-internal/openapi-docs","protocol": "HTTP/1.1","response_code": "404","response_flags": "UAEX","bytes_received": "0","bytes_sent": "9","duration": "2","upstream_service_time": "-","x_forwarded_for": "10.200.4.105","user_agent": "Go-http-client/1.1","correlation_id": "-","authority": "127.0.0.1:8443","upstream_host": "-","upstream_cluster": "-","upstream_local_address": "-","downstream_local_address": "127.0.0.1:8443","downstream_remote_address": "127.0.0.1:42440","requested_server_name": "-","istio_policy_status": "-","upstream_transport_failure_reason": "-"}
2111:{"start_time": "2020-09-01T03:55:24.620Z","method": "GET","path": "/nexus-news-items/v2-local/.ambassador-internal/openapi-docs","protocol": "HTTP/1.1","response_code": "200","response_flags": "-","bytes_received": "0","bytes_sent": "87932","duration": "3","upstream_service_time": "1","x_forwarded_for": "10.200.4.105","user_agent": "curl/7.66.0","correlation_id": "-","authority": "127.0.0.1:8443","upstream_host": "10.200.132.179:80","upstream_cluster": "cluster_uat_app_cwh_assets_v2_technology_newsroom_system","upstream_local_address": "10.200.4.105:34856","downstream_local_address": "127.0.0.1:8443","downstream_remote_address": "127.0.0.1:43890","requested_server_name": "-","istio_policy_status": "-","upstream_transport_failure_reason": "-"}

Expected behavior devportal backend should able to curl the API doucment with the host header or should able to scrape it via 127.0.0.1:8443 (at the meantime curl is working inside the pod)

Versions (please complete the following information):

cakuros commented 4 years ago

There was a bit of a regression in the dev portal in 1.7.0. Can you test with 1.7.1 and try again? (see: https://github.com/datawire/ambassador/blob/master/CHANGELOG.md#171-september-08-2020)

chris-ng-scmp commented 4 years ago

There was a bit of a regression in the dev portal in 1.7.0. Can you test with 1.7.1 and try again? (see: https://github.com/datawire/ambassador/blob/master/CHANGELOG.md#171-september-08-2020)

@cakuros Thank you, I can see no more 404 errors, but the Dev Portal still showing No API Documentation

{"start_time": "2020-09-22T03:31:31.130Z","method": "GET","path": "/nexus-news-items/v2/.ambassador-internal/openapi-docs","protocol": "HTTP/1.1","response_code": "200","response_flags": "-","bytes_received": "0","bytes_sent": "80967","duration": "5","upstream_service_time": "1","x_forwarded_for": "10.200.2.138","user_agent": "Go-http-client/1.1","correlation_id": "-","authority": "masked.abc","upstream_host": "10.200.132.179:80","upstream_cluster": "cluster_uat_app_cwh_assets_v2_technology_newsroom_system","upstream_local_address": "10.200.2.138:37000","downstream_local_address": "127.0.0.1:8443","downstream_remote_address": "127.0.0.1:44016","requested_server_name": "-","istio_policy_status": "-","upstream_transport_failure_reason": "-"}

here is the content of /nexus-news-items/v2/.ambassador-internal/openapi-docs

openapi: 3.0.0
info:
  title: Content Warehouse Asset API
  version: 0.0.1
  contact:
    email: abc@masked.abc
servers:
  - url: http://localhost:3001
    description: local development in own network
  - url: http://localhost:8080/cwh/v2/assets
    description: local development in the cwh network through Traefik reverse proxy
  - url: https://masked.abc/cwh/v2/assets
    variables:
      env:
        enum:
          - "migration"
          - "uat"
          - "stg"
        default: "uat"
  - url: "{serverUrl}"
    variables:
      serverUrl:
        description: override any presets
        default: /cwh/v2/assets

security:
  - CookieAuth: []
  - AccessTokenAuth: []
paths:
  /search:
    post:
      tags:
        - "newsitems"
      summary: Get a news_item metadata by query. Sort by inputted date.
      requestBody:
        required: true
        description: At least one of byNewsItemIDs or byJobID need to be provided.
        content:
          application/json:
            schema:
              type: object
              properties:
                byNewsItemIDs:
                  description: Filter base on newsItemsIDs
                  type: object
                  properties:
                    ids:
                      type: array
                      items:
                        type: string
                byJobID:
                  description: Filter base on jobID
                  type: object
                  properties:
                    ids:
                      type: string
                byItemClass:
                  description: Filter by itemClass
                  type: object
                  properties:
                    itemClass:
                      type: string
                      enum:
                        - "article"
                        - "graphic"
                        - "page"
                        - "photo"
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/NewsItem"
  /{id}:
    get:
      tags:
        - "newsitems"
      summary: Get a news_item metadata by ID
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NewsItem"
  /{id}/swap-item-class:
    post:
      tags:
        - "newsitems"
      summary: Swap item class between photo and graphic by ID
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NewsItem"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /reports/metadata:
    post:
      tags:
        - "reports"
      summary: Get metadata reports in csv format. Can only include either publication of file history.
      parameters:
        - in: query
          name: receiver
          schema:
            type: string
            enum:
              - "slack"
          description: Indicate the client to receiver the report. Default will send to the request client as response.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                newsItemIDs:
                  type: array
                  items:
                    type: string
                fields:
                  type: array
                  items:
                    type: object
                    properties:
                      label:
                        description: The label of the field
                        type: string
                      path:
                        description: The jsonpath of the field
                        type: string
      responses:
        "200":
          description: Successful operation
          content:
            text/csv:
              schema:
                type: string
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /articles/{id}:
    put:
      tags:
        - "articles"
      summary: Update an article metadata by ID. Publication and archive Information will not updated.
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Article"
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Article"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/UnprocessableEntity"
    delete:
      tags:
        - "articles"
      summary: Remove the article, together with publication history and custom links related to this article. The previous version of the same feed and jobID will become the new latest article.
      parameters:
        - in: path
          name: id
          description: The id of the news item
          schema:
            type: string
          required: true
      responses:
        "204":
          description: Successful operation
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /articles/{id}/raw:
    get:
      tags:
        - "articles"
      summary: Get single article in text format
      parameters:
        - in: path
          name: id
          schema:
            type: string
          description: ID of current article, published article or archived article
          required: true
        - in: query
          name: client
          schema:
            type: string
            enum:
              - "nexus"
              - "methode"
              - "swing"
              - "merlin"
              - "mx"
              - "m4"
              - "photoMASKED"
          description: Supported clients of the request, default as `methode`
        - in: query
          name: action
          schema:
            type: string
            enum:
              - "insert"
              - "download"
              - "replaceImage"
              - "unknown"
              - "email"
              - "syndication"
          description: Supported actions of the request, default as `insert`
      responses:
        "200":
          description: Successful operation
          content:
            text/plain:
              schema:
                example: "Article Status: PUBLISH\nArticle Version: v1\nLast Modified: 10 January 2020 03:27:10.167\n\nPublication Date: 2019/10/02 \nPublication Type: print \nPublication: Posties \nSection/PageName: YoungPost/Posties_Feature \nPage No: 03 \nEdition/Zone: E1/Z1 \nSupplement: posties \nURL: http://www.masked.abc/methode/63c51876-a19b-11e6-b05c-0413422fb257 \n\nHeadline: Let's go... to Macau! \nSubhead: Before you read: What should you see and do if you have 24 hours in our next-door city? \nByline: Written by Zachary Perez Jones \nCredit: Someone \nRemarks: Check remarks \n\nStory: testing story \n\nCaption: Senado Square; \n\nColumn: discover \nWord Count: 474 \nMerlin ID: 62146613 \nLinking IDs: MER1911051523202370, c300df34085211eaa68f66ebddf9f136 \nKeywords: TRAVEL, MACAU \nControlled Keywords: TRAVEL, MACAU"
                type: string
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/UnprocessableEntity"
  /articles/raw:
    post:
      tags:
        - "articles"
      summary: Get multiple articles in text format
      parameters:
        - in: query
          name: client
          schema:
            type: string
            enum:
              - "nexus"
              - "methode"
              - "swing"
              - "merlin"
              - "mx"
              - "m4"
              - "photoMASKED"
          description: Supported clients of the request, default as `methode`
        - in: query
          name: action
          schema:
            type: string
            enum:
              - "insert"
              - "download"
              - "replaceImage"
              - "unknown"
              - "email"
              - "syndication"
          description: Supported actions of the request, default as `insert`
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ids:
                  type: array
                  items:
                    type: string
                    format: uuid
      responses:
        "200":
          description: Successful operation
          content:
            text/plain:
              schema:
                example: "Article Status: PUBLISH\nArticle Version: v1\nLast Modified: 10 January 2020 03:27:10.167\n\nPublication Date: 2019/10/02 \nPublication Type: print \nPublication: Posties \nSection/PageName: YoungPost/Posties_Feature \nPage No: 03 \nEdition/Zone: E1/Z1 \nSupplement: posties \nURL: http://www.masked.abc/methode/63c51876-a19b-11e6-b05c-0413422fb257 \n\nHeadline: Let's go... to Macau! \nSubhead: Before you read: What should you see and do if you have 24 hours in our next-door city? \nByline: Written by Zachary Perez Jones \nCredit: Someone \nRemarks: Check remarks \n\nStory: testing story \n\nCaption: Senado Square; \n\nColumn: discover \nWord Count: 474 \nMerlin ID: 62146613 \nLinking IDs: MER1911051523202370, c300df34085211eaa68f66ebddf9f136 \nKeywords: TRAVEL, MACAU \nControlled Keywords: TRAVEL, MACAU \n----------------------------------------------------------------------"
                type: string
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/UnprocessableEntity"
  /articles:
    get:
      tags:
        - "articles"
      summary: Get a list of published articles by filtering. At least one of query params should be provided.
      parameters:
        - in: query
          name: jobID
          schema:
            type: string
          description: Query param. Filter articles base on job id
          required: false
        - in: query
          name: feed
          schema:
            type: string
          description: Filter by article feed
          required: false
        - in: query
          name: isTrashed
          schema:
            type: boolean
          description: Filter articles base on isTrashed status
          required: false
      responses:
        "200":
          description: Successful operation. If no resources found, empty list will be returned instead of 404 code
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Article"
        "422":
          $ref: "#/components/responses/UnprocessableEntity"
  /articles/{id}/archive:
    put:
      tags:
        - "articles"
      summary: Update archive info.
      parameters:
        - in: path
          name: id
          description: The id of the news item
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ArchiveInfo"
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ArchiveInfo"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /articles/sync:
    post:
      tags:
        - "articles"
      summary: Sync a Methode article. Input version will be ignored and computed in service.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                article:
                  $ref: "#/components/schemas/Article"
                publicationInfo:
                  type: object
                  properties:
                    name:
                      type: string
                      description: Publication name
                      example: MASKED
                    versionInfo:
                      $ref: "#/components/schemas/PubHistoryVersionInfo"
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Article"
        "409":
          $ref: "#/components/responses/Conflict"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /articles/{id}/trash:
    put:
      tags:
        - "articles"
      summary: Update trash info.
      parameters:
        - in: path
          name: id
          description: The id of the news item
          schema:
            type: string
          required: true
        - in: query
          name: includeAllVersions
          description: Indicate to include all existing versions related to this article
          schema:
            type: boolean
            default: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                isTrashed:
                  type: boolean
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Article"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /photos/{id}:
    put:
      tags:
        - "photos"
      summary: Replace photo metadata by ID
      parameters:
        - in: path
          name: id
          description: Key of the OSS object
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Photo"
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Photo"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/UnprocessableEntity"
  /photos/{id}/raw:
    get:
      tags:
        - "photos"
      summary: Get a raw photo by ID
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: query
          name: client
          schema:
            type: string
            enum:
              - "nexus"
              - "methode"
              - "swing"
              - "merlin"
              - "mx"
              - "m4"
              - "photoMASKED"
          description: Supported clients of the request, default as `methode`
        - in: query
          name: action
          schema:
            type: string
            enum:
              - "insert"
              - "download"
              - "replaceImage"
              - "unknown"
              - "email"
              - "syndication"
          description: Supported actions of the request, default as `insert`
      responses:
        "200":
          description: Successful operation
          content:
            image/*:
              schema:
                type: string
                format: binary
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /photos/{id}/{size}:
    get:
      tags:
        - "photos"
      summary: Get a photo by ID & Size
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: size
          description: The size of the photo to return
          schema:
            type: string
            enum:
              - large
              - middle
              - small
              - thumbnail
          required: true
      responses:
        "200":
          description: Successful operation
          content:
            image/*:
              schema:
                type: string
                format: binary
  /photos/pending/{id}/metadata:
    get:
      tags:
        - "photos"
      summary: Extract metadata from pending photo
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PhotoMetadataResponse"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /photos/save:
    post:
      tags:
        - "photos"
      summary: Index photo data to database and move file copy file from temp to perm storage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: "#/components/schemas/Photo"
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Photo"
        "207":
          description: The request contains multiple error
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/Photo"
                  error:
                    type: object
                    additionalProperties:
                      $ref: "#/components/schemas/Error"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /photos/{id}/archive:
    put:
      tags:
        - "photos"
      summary: Update archive info.
      parameters:
        - in: path
          name: id
          description: The id of the news item
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ArchiveInfo"
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ArchiveInfo"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /photos/{id}/trash:
    put:
      tags:
        - "photos"
      summary: Update trash info.
      parameters:
        - in: path
          name: id
          description: The id of the news item
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                isTrashed:
                  type: boolean
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Photo"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /photos/{id}/remote-content:
    put:
      tags:
        - "photos"
      summary: Replace remote content.
      parameters:
        - in: path
          name: id
          description: The id of the news item
          schema:
            type: string
          required: true
        - in: query
          name: client
          description: The name of the client making this request
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                pendingID:
                  description: The id of the pending photo
                  type: string
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Photo"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /photos/{id}/watermark:
    put:
      tags:
        - "photos"
      summary: Toggle watermark on the item.
      parameters:
        - in: path
          name: id
          description: The id of the news item
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                isWatermarked:
                  type: boolean
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Photo"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /pages:
    get:
      tags:
        - "pages"
      summary: Get list of page by link_id
      parameters:
        - in: query
          name: link_id
          schema:
            type: string
          required: true
      responses:
        "200":
          description: Successful operation. If no resources found, empty list will be returned instead of 404 code
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Page"
        "422":
          $ref: "#/components/responses/UnprocessableEntity"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /pages/{id}:
    put:
      tags:
        - "pages"
      summary: Replace page metadata by ID
      description: Don't update `itemMeta.links` with this endpoint. Use `pages/{id}/links` for updating links.
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Page"
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Page"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/UnprocessableEntity"
  /pages/{id}/raw:
    get:
      tags:
        - "pages"
      summary: Get a raw page by ID
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: query
          name: client
          schema:
            type: string
            enum:
              - "nexus"
              - "methode"
              - "swing"
              - "merlin"
              - "mx"
              - "m4"
              - "photoMASKED"
          description: Supported clients of the request, default as `methode`
        - in: query
          name: action
          schema:
            type: string
            enum:
              - "insert"
              - "download"
              - "replaceImage"
              - "unknown"
              - "email"
              - "syndication"
          description: Supported actions of the request, default as `insert`
      responses:
        "200":
          description: Successful operation
          content:
            image/*:
              schema:
                type: string
                format: binary
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /pages/{id}/thumbnail:
    put:
      tags:
        - "pages"
      summary: Add remoteContentItem into a page data which is the rendition is `rnd:thumbnail`
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              items:
                allOf:
                  - $ref: "#/components/schemas/RemoteContent"
                  - type: object
                    properties:
                      contentType:
                        type: string
                        enum:
                          - "image/jpeg"
                      rendition:
                        type: string
                        enum:
                          - "rnd:thumbnail"
      responses:
        "200":
          description: Successful operation
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "422":
          $ref: "#/components/responses/UnprocessableEntity"
    delete:
      tags:
        - "pages"
      summary: Delete remoteContentItem in the remoteContent array which is the rendition is `rnd:thumbnail`
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
      responses:
        "204":
          description: Successful operation
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/UnprocessableEntity"
  /pages/{id}/{rendition}:
    get:
      tags:
        - "pages"
      summary: Get a page by ID & Rendition
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: rendition
          schema:
            type: string
            enum:
              - thumbnail
              - print
          required: true
      responses:
        "200":
          description: Successful operation
          content:
            application/pdf:
              schema:
                type: string
                format: binary
            image/*:
              schema:
                type: string
                format: binary
  /pages/pending/{id}/metadata:
    get:
      tags:
        - "pages"
      summary: Extract metadata from pending page
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PageMetadataResponse"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /pages/sync:
    post:
      tags:
        - "pages"
      summary: Move pending file from storage to active and save the passed page entity with pub-history created in database
      description: Value of `itemMeta.links` will be ignored. Use `pages/{id}/links` for updating links.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                page:
                  $ref: "#/components/schemas/Page"
                pubHistory:
                  $ref: "#/components/schemas/PubHistory"
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Page"
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "409":
          $ref: "#/components/responses/Conflict"
        "422":
          $ref: "#/components/responses/UnprocessableEntity"
  /pages/{id}/archive:
    put:
      tags:
        - "pages"
      summary: Update archive info.
      parameters:
        - in: path
          name: id
          description: The id of the news item
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ArchiveInfo"
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ArchiveInfo"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /pages/{id}/trash:
    put:
      tags:
        - "pages"
      summary: Update trash info.
      parameters:
        - in: path
          name: id
          description: The id of the news item
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                isTrashed:
                  type: boolean
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Page"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /graphics/{id}:
    put:
      tags:
        - "graphics"
      summary: Replace graphic metadata by ID
      parameters:
        - in: path
          name: id
          description: Key of the OSS object
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Graphic"
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Graphic"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/UnprocessableEntity"
  /graphics/{id}/raw:
    get:
      tags:
        - "graphics"
      summary: Get a raw graphic by ID
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: query
          name: client
          schema:
            type: string
            enum:
              - "nexus"
              - "methode"
              - "swing"
              - "merlin"
              - "mx"
              - "m4"
              - "photoMASKED"
          description: Supported clients of the request, default as `methode`
        - in: query
          name: action
          schema:
            type: string
            enum:
              - "insert"
              - "download"
              - "replaceImage"
              - "unknown"
              - "email"
              - "syndication"
          description: Supported actions of the request, default as `insert`
      responses:
        "200":
          description: Successful operation
          content:
            image/jpeg, image/png, image/svg+xml, application/pdf:
              schema:
                type: string
                format: binary
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        "500":
          $ref: "#/components/responses/InternalServerError"
  /graphics/{id}/{rendition}:
    get:
      tags:
        - "graphics"
      summary: Get a graphic by ID & Rendition
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
        - in: path
          name: rendition
          schema:
            type: string
            enum:
              - web
              - thumbnail
          required: true
      responses:
        "200":
          description: Successful operation
          content:
            image/jpeg, image/png, image/svg+xml, application/pdf:
              schema:
                type: string
                format: binary
  /graphics/pending/{id}/metadata:
    get:
      tags:
        - "graphics"
      summary: Extract metadata from pending graphic
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GraphicMetadataResponse"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /graphics/save:
    post:
      tags:
        - "graphics"
      summary: Save and index pending graphics to database
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: "#/components/schemas/Graphic"
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Graphic"
        "207":
          description: The request contains multiple error
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/Graphic"
                  error:
                    type: object
                    additionalProperties:
                      $ref: "#/components/schemas/Error"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /graphics/{id}/archive:
    put:
      tags:
        - "graphics"
      summary: Update archive info.
      parameters:
        - in: path
          name: id
          description: The id of the news item
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ArchiveInfo"
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ArchiveInfo"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /graphics/{id}/trash:
    put:
      tags:
        - "graphics"
      summary: Update trash info.
      parameters:
        - in: path
          name: id
          description: The id of the news item
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                isTrashed:
                  type: boolean
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Graphic"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /graphics/{id}/watermark:
    put:
      tags:
        - "graphics"
      summary: Toggle watermark on the item. Item that is pdf and postscript are not supported.
      parameters:
        - in: path
          name: id
          description: The id of the news item
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                isWatermarked:
                  type: boolean
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Photo"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"

  /upload/{content-type}:
    post:
      tags:
        - "upload"
      summary: Return a post object for uploading with http post to oss.
      parameters:
        - in: path
          name: content-type
          schema:
            type: string
            enum:
              - photos
              - graphics
              - pages
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filename:
                  type: string
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PostObject"
        "401":
          $ref: "#/components/responses/Unauthorized"
  /file-histories/search:
    post:
      tags:
        - "file histories"
      summary: Return a list of file histories by filtering. At least one of query params should be provided.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                newsItemIDs:
                  type: array
                  items:
                    type: string
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FileHistoriesResponse"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /{id}/custom-links:
    post:
      tags:
        - "custom links"
      summary: Create a custom link of news item
      parameters:
        - in: path
          name: id
          description: The id of the news item
          schema:
            type: string
          required: true
      requestBody:
        required: true
        description: The list of id and item class to build custom links with
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/CustomLink"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
    put:
      tags:
        - "custom links"
      summary: Upsert custom links of news item
      parameters:
        - in: path
          name: id
          description: The id of the news item
          schema:
            type: string
          required: true
      requestBody:
        required: true
        description: The list of id and item class to build custom links with
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/CustomLink"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
    delete:
      tags:
        - "custom links"
      summary: Remove all custom links of news item
      parameters:
        - in: path
          name: id
          description: The id of the news item
          schema:
            type: string
          required: true
      responses:
        "204":
          description: Successful operation
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /{id}/custom-links/sync:
    put:
      tags:
        - "custom links"
      summary: Sync custom links of news item. NO validation enforced.
      parameters:
        - in: path
          name: id
          description: The id of the news item
          schema:
            type: string
          required: true
      requestBody:
        required: true
        description: The list of id and item class to build custom links with
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
      responses:
        "200":
          description: Successful operation
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /{id}/custom-links/{item-id}:
    delete:
      tags:
        - "custom links"
      summary: Remove a custom links by id
      parameters:
        - in: path
          name: id
          description: The id of the news item
          schema:
            type: string
          required: true
        - in: path
          name: item-id
          description: The id of custom link
          schema:
            type: string
          required: true
      responses:
        "204":
          description: Successful operation
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /healthz/liveness:
    get:
      tags:
        - "healthz"
      summary: Get service health status
      responses:
        "200":
          description: Successful operation
  /healthz/readiness:
    get:
      tags:
        - "healthz"
      summary: Get service external dependencies health status
      responses:
        "200":
          description: Successful operation
        "500":
          $ref: "#/components/responses/InternalServerError"
  /custom-links/search:
    post:
      tags:
        - "custom links"
      summary: Get custom links by query.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                newsItemIDs:
                  type: array
                  items:
                    type: string
                includeTrashed:
                  description: Include trashed news item version info/version news item
                  type: boolean
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/CustomLink"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /controlled-keywords:
    get:
      tags:
        - "controlled keywords"
      summary: Get full list of controlled keywords (no pagination currently)
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/ControlledKeyword"
        "401":
          $ref: "#/components/responses/Unauthorized"
  /pub-histories/search:
    post:
      tags:
        - "pub histories"
      summary: "search a list of published history filtered by parameters"
      description: ""
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                byBothNewsItemID:
                  description: Filter base on publishedNewsItemsID or NewsItemsID in usage
                  type: object
                  properties:
                    id:
                      type: string
                publishedNewsItemStatus:
                  description: Filter results with status of published news items
                  type: string
                  enum:
                    - all
                    - trashed
                    - nonTrashed
                  default:
                    - nonTrashed
                versionNewsItemStatus:
                  description: Filter results with status of version news items
                  type: string
                  enum:
                    - all
                    - trashed
                    - nonTrashed
                  default:
                    - nonTrashed
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/PubHistory"
        "422":
          $ref: "#/components/responses/UnprocessableEntity"
  /pub-histories:
    post:
      tags:
        - "pub histories"
      summary: "create a published history"
      description: ""
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PubHistory"
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PubHistory"
        "422":
          $ref: "#/components/responses/UnprocessableEntity"
  /pub-histories/{id}:
    patch:
      tags:
        - "pub histories"
      summary: "Update partial information in published history. Pass null to indicate no update for specific part."
      parameters:
        - in: path
          name: id
          description: "ID for a published history record"
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                pubHistoryInfo:
                  type: object
                  properties:
                    name:
                      type: string
                    type:
                      type: string
                      enum:
                        - "digital"
                        - "print"
                    published:
                      type: string
                      format: date-time
                versionInfoToUpdate:
                  type: object
                  properties:
                    id:
                      type: string
                      format: uuid
                    versionInfo:
                      $ref: "#/components/schemas/PubHistoryVersionInfo"
                    newsItemToUpdate:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        newsItemInfo:
                          type: object
                          properties:
                            caption:
                              type: string
                newsItemsToRemove:
                  type: array
                  items:
                    type: string
                    format: uuid
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PubHistory"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/UnprocessableEntity"
  /pub-histories/{id}/versions/{version}/newsitems/{newsItemID}:
    delete:
      tags:
        - "pub histories"
      summary: "delete a news item from a version in the specific published history"
      parameters:
        - in: path
          name: id
          description: "ID for a published history record"
          schema:
            type: string
          required: true
        - in: path
          name: version
          description: "version number or ID in a published history record"
          schema:
            type: integer
          required: true
        - in: path
          name: newsItemID
          description: "news item ID in a version of a published history record"
          schema:
            type: integer
            format: uuid
          required: true
      responses:
        "204":
          description: Successful operation
        "401":
          $ref: "#/components/responses/Unauthorized"
        "400":
          $ref: "#/components/responses/BadRequest"
  /published-newsitems/{id}/newsitems:
    post:
      tags:
        - "published newsitems"
      summary: "add news items to a published news item's published history"
      parameters:
        - in: path
          name: id
          description: "ID for a published news item"
          schema:
            type: string
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: "#/components/schemas/PubHistoryVersionNewsItem"
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/PubHistoryVersionNewsItem"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/UnprocessableEntity"
  /schema/version:
    get:
      tags:
        - settings
      summary: "get the latest schema version of each domain model"
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  article:
                    type: number
                  fileHistory:
                    type: number
                  graphic:
                    type: number
                  page:
                    type: number
                  photo:
                    type: number
                  pubHistory:
                    type: number
  /info:
    get:
      tags:
        - service info
      summary: "get the latest build and migration informations"
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  serviceName:
                    type: string
                    example: cwh-assets
                  commit:
                    type: string
                    example: 69c930fe8da023e579fc925c269552db22a69bc3
                  tag:
                    type: string
                    example: ""
                  pipeline:
                    type: number
                    example: 171925
                  jobID:
                    type: number
                    example: 171925
                  lastMigration:
                    properties:
                      version:
                        type: number
                        example: 6
                      status:
                        type: string
                        example: "done"
                      created:
                        type: string
                        format: date-time
                      modified:
                        type: string
                        format: date-time
components:
  securitySchemes:
    AccessTokenAuth:
      type: apiKey
      in: header
      name: X-Access-Token
    CookieAuth:
      type: apiKey
      in: cookie
      name: TOKEN
  responses:
    BadRequest:
      description: The format of request is not correct
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    Unauthorized:
      description: Unauthorized
    UnprocessableEntity:
      description: The format of request is correct, but rejected by other reason
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    NotFound:
      description: The format of request is correct, but the resource requested cannot be found
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    Conflict:
      description: The request is conflict
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    InternalServerError:
      description: The request is not fulfilled because of the server encountered an unexpected condition
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"

  schemas:
    NewsItem:
      description: Article represents the news_items model according to schema referencing IPTC NewsML-G2 standard
      type: object
      oneOf:
        - $ref: "#/components/schemas/Photo"
        - $ref: "#/components/schemas/Graphic"
        - $ref: "#/components/schemas/Page"
        - $ref: "#/components/schemas/Article"
    Article:
      description: Article represents the latest article model according to schema referencing IPTC NewsML-G2 standard
      type: object
      properties:
        id:
          type: string
        _uniqueID:
          type: string
        archiveInfo:
          $ref: "#/components/schemas/ArchiveInfo"
        itemMeta:
          $ref: "#/components/schemas/ArticleItemMeta"
        contentMeta:
          $ref: "#/components/schemas/ArticleContentMeta"
        contentSet:
          $ref: "#/components/schemas/ArticleContentSet"
        rightsInfo:
          $ref: "#/components/schemas/ArticleRightsInfo"
        _schemaVersion:
          type: integer
    ArticleItemMeta:
      description: Subset of ItemMeta describes metadata of article itself
      type: object
      properties:
        edNotes:
          type: array
          items:
            type: object
            properties:
              role:
                type: string
                enum:
                  - cwhednoterole:correction
              value:
                type: string
        itemMetaEXTProperty:
          type: object
          properties:
            legacyInfo:
              $ref: "#/components/schemas/LegacyInfo"
            systemInfo:
              $ref: "#/components/schemas/SystemInfo"
            remarks:
              type: string
            isHidden:
              type: boolean
              description: Indicate this record is hidden or not for the general public.
            feed:
              type: string
            isSyndicatable:
              type: boolean
              description: Indicate this record is ready for syndication or not.
        links:
          type: array
          items:
            $ref: "#/components/schemas/LinkItem"
        itemClass:
          type: string
          enum:
            - "article"
        fileName:
          type: string
          example: news.xml
        expires:
          type: string
          format: date-time
    ArticleContentMeta:
      description: Content metadata of the article
      type: object
      properties:
        altIDs:
          type: array
          items:
            type: object
            properties:
              role:
                type: string
                enum:
                  - "altidrole:pmdJobId"
              value:
                type: string
                format: uuid
        by:
          type: string
        contentCreated:
          type: string
          format: date-time
        creators:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              related:
                type: array
                items:
                  type: object
                  properties:
                    rel:
                      $ref: "#/components/schemas/CreatorCategory"
                    name:
                      type: string
        creditline:
          type: string
        description:
          type: array
          items:
            type: object
            properties:
              role:
                type: string
                enum:
                  - "drol:summary"
                  - "drol:teaser"
                  - "drol:caption"
              value:
                type: string
        headline:
          type: string
        keywords:
          type: array
          items:
            type: string
        column:
          type: string
        contentMetaEXTProperty:
          type: object
          properties:
            controlledKeywords:
              type: array
              items:
                type: string
    ArticleContentSet:
      description: Content of the article
      type: object
      properties:
        inlineData:
          type: object
          properties:
            wordcount:
              type: integer
            value:
              type: string
    ArticleRightsInfo:
      type: object
      properties:
        copyrightHolder:
          type: object
          properties:
            name:
              type: string
        rightsInfoEXTProperty:
          properties:
            hasCopyright:
              type: boolean
            creatorCategories:
              type: array
              items:
                $ref: "#/components/schemas/CreatorCategory"
    PostObject:
      description: A post object request
      type: object
      properties:
        id:
          type: string
          description: ID of the upload asset
        host:
          type: string
          description: Host that the post asset request should sent
        extraFields:
          type: object
          description: Extra fields that should be sent together with the post request
    Error:
      description: An error information
      type: object
      properties:
        name:
          type: string
        code:
          type: integer
        status:
          type: integer
        message:
          type: string
        info:
          description: Extra information related to the error
          type: object
    Graphic:
      description: Graphic represents the latest graphic model according to schema referencing IPTC NewsML-G2 standard
      type: object
      required:
        - id
      properties:
        id:
          type: string
        _schemaVersion:
          type: integer
        archiveInfo:
          $ref: "#/components/schemas/ArchiveInfo"
        trashInfo:
          $ref: "#/components/schemas/TrashInfo"
        contentMeta:
          $ref: "#/components/schemas/ContentMeta"
        contentSet:
          type: object
          properties:
            remoteContent:
              type: array
              items:
                allOf:
                  - $ref: "#/components/schemas/RemoteContent"
                  - type: object
                    properties:
                      contentType:
                        type: string
                        enum:
                          - "application/pdf"
                          - "application/postscript"
                          - "image/jpeg"
                          - "image/png"
                          - "image/svg+xml"
                          - "image/tiff"
                          - "image/webp"
        itemMeta:
          allOf:
            - $ref: "#/components/schemas/ItemMeta"
            - type: object
              properties:
                itemClass:
                  type: string
                  enum:
                    - "graphic"
        rightsInfo:
          $ref: "#/components/schemas/RightsInfo"
    GraphicMetadataResponse:
      description: Graphic metadata response represents the extracted metadata of a graphic, responses with data and indicating if the data is partially extracted.
      type: object
      properties:
        data:
          $ref: "#/components/schemas/Graphic"
        partiallyExtracted:
          type: boolean
          description: Indicate if the data is partially extracted. False means fully extracted.
    Page:
      description: Page represents the latest page model according to schema referencing IPTC NewsML-G2 standard
      type: object
      required:
        - id
      properties:
        id:
          type: string
        archiveInfo:
          $ref: "#/components/schemas/ArchiveInfo"
        contentMeta:
          $ref: "#/components/schemas/PageContentMeta"
        contentSet:
          $ref: "#/components/schemas/PageContentSet"
        itemMeta:
          $ref: "#/components/schemas/PageItemMeta"
        rightsInfo:
          $ref: "#/components/schemas/PageRightsInfo"
        _schemaVersion:
          type: integer
    Photo:
      description: Photo represents the latest photo model according to schema referencing IPTC NewsML-G2 standard
      type: object
      required:
        - id
      properties:
        id:
          type: string
        archiveInfo:
          $ref: "#/components/schemas/ArchiveInfo"
        trashInfo:
          $ref: "#/components/schemas/TrashInfo"
        contentMeta:
          $ref: "#/components/schemas/ContentMeta"
        contentSet:
          type: object
          properties:
            remoteContent:
              type: array
              items:
                allOf:
                  - $ref: "#/components/schemas/RemoteContent"
                  - type: object
                    properties:
                      contentType:
                        type: string
                        enum:
                          - "image/gif"
                          - "image/png"
                          - "image/jpeg"
                          - "image/tiff"
                          - "image/webp"
        itemMeta:
          allOf:
            - $ref: "#/components/schemas/ItemMeta"
            - type: object
              properties:
                itemClass:
                  type: string
                  enum:
                    - "photo"
        rightsInfo:
          $ref: "#/components/schemas/RightsInfo"
        _schemaVersion:
          type: integer
    PhotoMetadataResponse:
      description: Photo metadata response represents the extracted metadata of a photo, responses with data and indicating if the data is partially extracted.
      type: object
      properties:
        data:
          $ref: "#/components/schemas/Photo"
        partiallyExtracted:
          type: boolean
          description: Indicate if the data is partially extracted. False means fully extracted.
    PageContentMeta:
      description: Subset of ContentMeta
      type: object
      properties:
        altIDs:
          type: array
          items:
            type: object
            properties:
              role:
                type: string
              value:
                type: string
        contentCreated:
          type: string
          format: date-time
        contentMetaEXTProperty:
          type: object
          properties:
            controlledKeywords:
              type: array
              items:
                type: string
        contributors:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              role:
                $ref: "#/components/schemas/ContentProductionPartyRole"
        creators:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              related:
                type: array
                items:
                  type: object
                  properties:
                    qcode:
                      type: string
                    rel:
                      type: string
    PageContentSet:
      type: object
      properties:
        remoteContent:
          type: array
          items:
            allOf:
              - $ref: "#/components/schemas/RemoteContent"
              - type: object
                properties:
                  contentType:
                    type: string
                    enum:
                      - "application/pdf"
                      - "image/jpeg"
                      - "image/png"
        inlineData:
          type: object
          properties:
            value:
              type: string
    PageItemMeta:
      description: Subset of ItemMeta
      type: object
      properties:
        itemClass:
          type: string
          enum:
            - page
        itemMetaEXTProperty:
          type: object
          properties:
            legacyInfo:
              $ref: "#/components/schemas/LegacyInfo"
            systemInfo:
              $ref: "#/components/schemas/SystemInfo"
            isHidden:
              type: boolean
            isSyndicatable:
              type: boolean
        title:
          type: string
        fileName:
          type: string
        links:
          $ref: "#/components/schemas/LinkItem"
        expires:
          type: string
          format: date-time
        edNotes:
          type: array
          items:
            type: object
            properties:
              role:
                type: string
                enum:
                  - cwhednoterole:correction
              value:
                type: string
    PageRightsInfo:
      type: object
      properties:
        rightsInfoEXTProperty:
          properties:
            hasCopyright:
              type: boolean
    PageMetadataResponse:
      description: Page metadata response represents the extracted metadata of a page, responses with data and indicating if the data is partially extracted.
      type: object
      properties:
        data:
          $ref: "#/components/schemas/Page"
        partiallyExtracted:
          type: boolean
          description: Indicate if the data is partially extracted. False means fully extracted.
    ContentMeta:
      description: Subset of ContentMeta
      type: object
      properties:
        altIDs:
          type: array
          items:
            type: object
            properties:
              role:
                $ref: "#/components/schemas/AltIDRole"
              value:
                type: string
        contentCreated:
          type: string
          format: date-time
        contentMetaEXTProperty:
          type: object
          properties:
            controlledKeywords:
              type: array
              items:
                type: string
        contributors:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              role:
                $ref: "#/components/schemas/ContentProductionPartyRole"
        creators:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              related:
                type: array
                items:
                  type: object
                  properties:
                    qcode:
                      type: string
                    rel:
                      $ref: "#/components/schemas/CreatorRel"
        creditline:
          type: string
        descriptions:
          type: array
          items:
            type: object
            properties:
              role:
                $ref: "#/components/schemas/DescriptionRole"
              value:
                type: string
        headline:
          type: string
        infoSources:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              role:
                $ref: "#/components/schemas/ContentProductionPartyRole"
        keywords:
          type: array
          items:
            type: string
        located:
          type: object
          properties:
            poiDetails:
              type: object
              properties:
                address:
                  type: object
                  properties:
                    area:
                      type: object
                      properties:
                        name:
                          type: string
                    country:
                      type: object
                      properties:
                        name:
                          type: string
                        uri:
                          type: string
        subjects:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              qcode:
                type: string
              type:
                $ref: "#/components/schemas/SubjectType"
              uri:
                type: string
    ItemMeta:
      description: Subset of ItemMeta
      type: object
      properties:
        altIDs:
          type: array
          items:
            type: object
            properties:
              type:
                $ref: "#/components/schemas/AltIDType"
              value:
                type: string
        edNotes:
          type: array
          items:
            type: object
            properties:
              role:
                type: string
                enum:
                  - ednoterole:photoInstruction
                  - cwhednoterole:correction
              value:
                type: string
        fileName:
          type: string
        itemMetaEXTProperty:
          type: object
          properties:
            legacyInfo:
              $ref: "#/components/schemas/LegacyInfo"
            systemInfo:
              $ref: "#/components/schemas/SystemInfo"
            isHidden:
              type: boolean
            isSyndicatable:
              type: boolean
        title:
          type: string
        expires:
          type: string
          format: date-time
    RightsInfo:
      description: Subset of RightsInfo
      type: object
      properties:
        copyrightHolder:
          type: object
          properties:
            name:
              type: string
        copyrightNotice:
          type: string
        rightsInfoEXTProperty:
          type: object
          properties:
            hasCopyright:
              type: boolean
            creatorCategories:
              type: array
              items:
                $ref: "#/components/schemas/CreatorCategory"
        usageTerms:
          type: string
    RemoteContent:
      type: object
      properties:
        colorSpace:
          $ref: "#/components/schemas/ColorSpace"
        height:
          type: integer
        href:
          type: string
        layoutOrientation:
          $ref: "#/components/schemas/LayoutOrientation"
        rendition:
          $ref: "#/components/schemas/Rendition"
        size:
          type: integer
        width:
          type: integer
    LinkItem:
      description: Subset of link item information
      type: object
      properties:
        rel:
          type: string
          description: Link item relationship type in - [Item relation](http://cv.iptc.org/newscodes/itemrelation/)
          example: "irel:seeAlso"
        id:
          type: string
          description: Link item UUID in CWH services
        descriptions:
          type: array
          items:
            type: object
            properties:
              role:
                type: string
                enum:
                  - "drol:caption"
              value:
                type: string
        itemMetaEXTProperty:
          type: object
          properties:
            excludeFromPubHistory:
              type: boolean
    LegacyInfo:
      description: Subset of LegacyInfo
      type: object
      properties:
        merlinID:
          type: integer
        linkingIDs:
          type: array
          description: Photos linking up with the article.
          items:
            type: string
          example:
            - MER1911051523202370
            - c300df34085211eaa68f66ebddf9f136
    SystemInfo:
      description: Subset of SystemInfo
      type: object
      properties:
        feed:
          type: string
          description: Feed field represents the channel item type
          example: M_ABC
        modified:
          type: string
          format: date-time
        inputBy:
          type: string
        inputted:
          type: string
          format: date-time
        modifiedBy:
          type: string
    ItemClass:
      description: Content type in CWH services
      type: string
      enum:
        - "article"
        - "photo"
        - "graphic"
        - "page"
    AltIDRole:
      type: string
      enum:
        - altidrole:pmdImgGUID
        - altidrole:pmdImgSupplierImgId
        - altidrole:pmdJobId
    AltIDType:
      type: string
      enum:
        - gid
    ContentProductionPartyRole:
      type: string
      enum:
        - cpprole:cameraOperator
        - cpprole:contentSource
        - cpprole:correspondent
        - cpprole:descrWriter
        - cpprole:imgSupplier
        - cpprole:interviewee
        - cpprole:mediaOffice
        - cpprole:origcont
        - cpprole:originfo
        - cpprole:spokesperson
    CreatorRel:
      type: string
      enum:
        - entityprop:creatorJobtitle
        - crel:isA
    DescriptionRole:
      type: string
      enum:
        - drol:caption
        - drol:hashtag
        - drol:modelAge
        - drol:modelInfo
        - drol:summary
        - drol:teaser
    LayoutOrientation:
      type: string
      enum:
        - loutorient:horizontal
        - loutorient:square"
        - loutorient:unaligned
        - loutorient:vertical
    ColorSpace:
      type: string
      enum:
        - colsp:AdobeRGB
        - colsp:Bi-Level
        - colsp:CMY
        - colsp:CMY(K)
        - colsp:Greyscale
        - colsp:JCC
        - colsp:JCN
        - colsp:JCU
        - colsp:JMPA
        - colsp:L*a*b*_(K)_CIE
        - colsp:Palette
        - colsp:RGB
        - colsp:RGB_SMPTE
        - colsp:sRGB
        - colsp:X,Y,Z_CIE
        - colsp:YCbCr
        - colsp:Y,U,V_(K)
    Rendition:
      description: Value hinting about the rendition such as http://cv.iptc.org/newscodes/rendition/
      type: string
      enum:
        - "rnd:print"
        - "rnd:highRes"
        - "rnd:thumbnail"
        - "rnd:preview"
        - "rnd:web"
    SubjectType:
      type: string
      enum:
        - cpnat:abstract
        - cpnat:event
        - cpnat:geoArea
        - cpnat:object
        - cpnat:organisation
        - cpnat:person
        - cpnat:poi
    CreatorCategory:
      type: string
      enum:
        - contributor
        - handout
        - isd
        - organization
        - reader
        - staff
        - student
        - wire
    ArchiveInfo:
      description: Information about archiving
      type: object
      properties:
        isArchived:
          type: boolean
        archived:
          type: string
          format: date-time
        archivedBy:
          type: string
    CropSpec:
      type: object
      properties:
        x1:
          type: number
        y1:
          type: number
        x2:
          type: number
        y2:
          type: number
        width:
          type: number
        height:
          type: number
        rotation:
          type: number
    FileHistoriesResponse:
      type: array
      items:
        type: object
        properties:
          id:
            type: string
          newsItemID:
            type: string
          userID:
            type: string
          userName:
            type: string
          client:
            type: string
          action:
            type: string
          date:
            type: string
            format: date-time
          notes:
            type: string
          _schemaVersion:
            type: integer
    CustomLink:
      type: object
      properties:
        id:
          type: string
        firstNewsItemID:
          type: string
        secondNewsItemID:
          type: string
    ControlledKeyword:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
    PubHistory:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        type:
          type: string
          enum:
            - "digital"
            - "print"
        published:
          type: string
          format: date-time
        versions:
          type: array
          items:
            $ref: "#/components/schemas/PubHistoryVersions"
        _schemaVersion:
          type: integer
    PubHistoryVersions:
      type: object
      properties:
        version:
          type: integer
        publishedNewsItemID:
          type: string
          format: uuid
        versionInfo:
          $ref: "#/components/schemas/PubHistoryVersionInfo"
        newsItems:
          type: array
          items:
            $ref: "#/components/schemas/PubHistoryVersionNewsItem"
    PubHistoryVersionInfo:
      type: object
      properties:
        versionCreated:
          type: string
          format: date-time
        editionZone:
          type: string
        sectionPage:
          type: string
        supplement:
          type: string
        pageNumber:
          type: integer
        url:
          type: string
    PubHistoryVersionNewsItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
        caption:
          type: string
        cropSpec:
          type: array
          items:
            $ref: "#/components/schemas/CropSpec"
        createdBy:
          type: string
          format: uuid
    TrashInfo:
      description: Information about trash
      type: object
      properties:
        isTrashed:
          type: boolean
        trashed:
          type: string
          format: date-time
        trashedBy:
          type: string
stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

cindymullins-dw commented 2 years ago

Please try the latest version of Dev Portal and let us know if issues persist. The Dev Portal is now also integrated with Ambassador Cloud.