openapi: 3.0.3
info:
  title: Artifact Hub
  description: "Find, install and publish Cloud Native packages"
  version: 0.18.0
  contact:
    name: Artifact Hub support
    url: https://cloud-native.slack.com/channels/artifact-hub

servers:
  - url: "/"
tags:
  - name: Monocular
    description: ""
paths:
  /api/chartsvc/v1/charts/search:
    get:
      tags:
        - Monocular
      summary: Monocular compatible search API
      operationId: monocularSearch
      description: >-
        This endpoint provides a Monocular compatible search API that the Helm
        CLI search subcommand can use. The goal is to facilitate the transition
        from the Helm Hub to Artifact Hub, allowing the existing Helm tooling to
        continue working without modifications. This is a temporary solution and
        future Helm CLI versions should use the generic Artifact Hub search API.
      parameters:
        - $ref: "#/components/parameters/QueryParam"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        artifactHub:
                          type: object
                          properties:
                            packageUrl:
                              type: string
                        attributes:
                          type: object
                          properties:
                            description:
                              type: string
                            repo:
                              type: object
                              properties:
                                name:
                                  type: string
                                url:
                                  type: string
                                  format: uri
                        relationships:
                          type: object
                          properties:
                            latestChartVersion:
                              type: object
                              properties:
                                data:
                                  type: object
                                  properties:
                                    version:
                                      type: string
                                    app_version:
                                      type: string
              examples:
                test1:
                  value:
                    data:
                      - id: adfinis/barman
                        artifactHub:
                          packageUrl: "http://artifacthub.io/packages/helm/adfinis/barman"
                        attributes:
                          description: >-
                            Chart for Barman PostgreSQL Backup and Recovery
                            Manager
                          adfinis:
                            name: adfinis
                            url: https://charts.adfinis.com
                        relationships:
                          latestChartVersion:
                            data:
                              version: "0.0.8"
                              app_version: "2.1"
        "400":
          $ref: "#/components/responses/BadRequest"
        "429":
          $ref: "#/components/responses/TooManyRequests"
        "500":
          $ref: "#/components/responses/InternalServerError"
components:
  parameters:
    QueryParam:
      in: query
      name: q
      schema:
        type: string
        example: PostgreSQL
      required: false
      description: >-
        Text search query. Search terms can be combined using the syntax allowed
        by the PostgreSQL websearch_to_tsquery function. See
        https://www.postgresql.org/docs/current/textsearch-controls.html
        (12.3.2. Parsing Queries) for more details.
  responses:
    BadRequest:
      description: The request sent was not valid
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    InternalServerError:
      description: >-
        The server encountered an unexpected condition that prevented it from
        fulfilling the request
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    TooManyRequests:
      description: The user has sent too many requests in a given amount of time
  schemas:
    Error:
      type: object
      properties:
        message:
          type: string
          example: error details
