Uploaded image for project: 'Project Quay'
  1. Project Quay
  2. PROJQUAY-707

Quay API Doc create_a_private_repository give wrong example

XMLWordPrintable

    • 0

      Description:
      This is an issue found in Quay 3.3 API Doc, in section "1.4.5. Create a private repository", the example delivered to customers is not correct, two key points, 1st one is missing required header(#1), 2nd is in payload the required property "repository" should be use.
      see the correct example and wrong example execution, pls correct the API doc.

      Docs: https://access.redhat.com/documentation/en-us/red_hat_quay/3.3/html-single/red_hat_quay_api_guide/index#create_a_private_repository

      Correct Example:
      lizhang@lzha-mac auth_script % curl -X POST https://demo1-quayecosystem-quay-quay-enterprise.apps.lzha0513.qe.devcluster.openshift.com/api/v1/repository -H 'Authorization: Bearer ChLKQhnmWQrsxK7s4PBrO9OHKeyZGSLxyHaRhqBe' -H "Content-Type: application/json" -d '

      {"namespace":"quay","*repository*":"reponame101","description":"description of your repo","visibility":"private"}

      ' | jq

      {
      "kind": "image",
      "namespace": "quay",
      "name": "reponame101"
      }

      Wrong example:
      #1: Header -H "Content-Type: application/json" is required
      lizhang@lzha-mac auth_script % curl -X POST https://demo1-quayecosystem-quay-quay-enterprise.apps.lzha0513.qe.devcluster.openshift.com/api/v1/repository -d '

      {"namespace":"quay","name":"reponame100","description":"description of your repo","visibility":"private"}

      ' -H 'Authorization: Bearer ChLKQhnmWQrsxK7s4PBrO9OHKeyZGSLxyHaRhqBe'

      {"status": 400, "error_message": "Missing JSON body", "title": "invalid_request", "error_type": "invalid_request", "detail": "Missing JSON body", "type": "https://demo1-quayecosystem-quay-quay-enterprise.apps.lzha0513.qe.devcluster.openshift.com/api/v1/error/invalid_request"}

      #2: "repository" is MUST required in Payload
      lizhang@lzha-mac auth_script % curl -X POST https://demo1-quayecosystem-quay-quay-enterprise.apps.lzha0513.qe.devcluster.openshift.com/api/v1/repository -d '

      {"namespace":"quay","name":"reponame100","description":"description of your repo","visibility":"private"}

      ' -H 'Authorization: Bearer ChLKQhnmWQrsxK7s4PBrO9OHKeyZGSLxyHaRhqBe' -H "Content-Type: application/json"
      {"status": 400, "error_message": "'repository' is a required property\n\nFailed validating 'required' in schema:\n {'description': 'Description of a new repository',\n 'properties': {'description':

      {'description': 'Markdown encoded description for the repository',\n 'type': 'string'}

      ,\n 'namespace':

      {'description': 'Namespace in which the repository should be created. If omitted, the username of the caller is used',\n 'type': 'string'}

      ,\n 'repo_kind':

      {'description': 'The kind of repository',\n 'enum': ['image', 'application', None],\n 'type': ['string', 'null']}

      ,\n 'repository':

      {'description': 'Repository name',\n 'type': 'string'}

      ,\n 'visibility': {'description': 'Visibility which the repository will start with',\n 'enum': ['public', 'private'],\n 'type': 'string'}},\n 'required': ['repository', 'visibility', 'description'],\n 'type': 'object'}\n\nOn instance:\n

      {u'description': u'description of your repo',\n u'name': u'reponame100',\n u'namespace': u'quay',\n u'visibility': u'private'}

      ", "title": "invalid_request", "error_type": "invalid_request", "detail": "'repository' is a required property\n\nFailed validating 'required' in schema:\n {'description': 'Description of a new repository',\n 'properties': {'description':

      {'description': 'Markdown encoded description for the repository',\n 'type': 'string'}

      ,\n 'namespace':

      {'description': 'Namespace in which the repository should be created. If omitted, the username of the caller is used',\n 'type': 'string'}

      ,\n 'repo_kind':

      {'description': 'The kind of repository',\n 'enum': ['image', 'application', None],\n 'type': ['string', 'null']}

      ,\n 'repository':

      {'description': 'Repository name',\n 'type': 'string'}

      ,\n 'visibility': {'description': 'Visibility which the repository will start with',\n 'enum': ['public', 'private'],\n 'type': 'string'}},\n 'required': ['repository', 'visibility', 'description'],\n 'type': 'object'}\n\nOn instance:\n

      {u'description': u'description of your repo',\n u'name': u'reponame100',\n u'namespace': u'quay',\n u'visibility': u'private'}

      ", "type": "https://demo1-quayecosystem-quay-quay-enterprise.apps.lzha0513.qe.devcluster.openshift.com/api/v1/error/invalid_request"}

            rhn-support-stevsmit Steven Smith
            lzha1981 luffy zhang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: