-
Bug
-
Resolution: Done
-
Major
-
None
-
quay-v3.3.0
-
This Issue was merged on 6/10.
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.
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 '
' | 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 '
' -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 '
' -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':
,\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"}