Skip to content

Commit 8bb075a

Browse files
committed
resolve missing responses in openapi.json
1 parent 2240ea4 commit 8bb075a

File tree

2 files changed

+72
-10
lines changed

2 files changed

+72
-10
lines changed

api-docs/openapi.json

Lines changed: 66 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2001,8 +2001,7 @@
20012001
"required": true,
20022002
"schema": {
20032003
"type": "string"
2004-
},
2005-
"description": "The shortname of the organization"
2004+
}
20062005
},
20072006
{
20082007
"name": "username",
@@ -2011,14 +2010,77 @@
20112010
"schema": {
20122011
"type": "string"
20132012
}
2013+
},
2014+
{
2015+
"$ref": "#/components/parameters/apiEntityHeader"
2016+
},
2017+
{
2018+
"$ref": "#/components/parameters/apiUserHeader"
2019+
},
2020+
{
2021+
"$ref": "#/components/parameters/apiSecretHeader"
20142022
}
20152023
],
20162024
"responses": {
2025+
"200": {
2026+
"description": "Returns information about the specified registry user",
2027+
"content": {
2028+
"application/json": {
2029+
"schema": {
2030+
"$ref": "../schemas/registry-user/get-registry-user-response.json"
2031+
}
2032+
}
2033+
}
2034+
},
20172035
"400": {
2018-
"description": "Bad Request"
2036+
"description": "Bad Request",
2037+
"content": {
2038+
"application/json": {
2039+
"schema": {
2040+
"$ref": "../schemas/errors/bad-request.json"
2041+
}
2042+
}
2043+
}
20192044
},
20202045
"401": {
2021-
"description": "Unauthorized"
2046+
"description": "Not Authenticated",
2047+
"content": {
2048+
"application/json": {
2049+
"schema": {
2050+
"$ref": "../schemas/errors/generic.json"
2051+
}
2052+
}
2053+
}
2054+
},
2055+
"403": {
2056+
"description": "Forbidden",
2057+
"content": {
2058+
"application/json": {
2059+
"schema": {
2060+
"$ref": "../schemas/errors/generic.json"
2061+
}
2062+
}
2063+
}
2064+
},
2065+
"404": {
2066+
"description": "Not Found",
2067+
"content": {
2068+
"application/json": {
2069+
"schema": {
2070+
"$ref": "../schemas/errors/generic.json"
2071+
}
2072+
}
2073+
}
2074+
},
2075+
"500": {
2076+
"description": "Internal Server Error",
2077+
"content": {
2078+
"application/json": {
2079+
"schema": {
2080+
"$ref": "../schemas/errors/generic.json"
2081+
}
2082+
}
2083+
}
20222084
}
20232085
}
20242086
},

src/controller/org.controller/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,21 @@ router.get('/registry/org/:shortname/user/:username',
5858
<h2>Expected Behavior</h2>
5959
<p><b>Regular, CNA & Admin Users:</b> Retrieves information about a registry user in the same organization</p>
6060
<p><b>Secretariat:</b> Retrieves any registry user's information</p>"
61+
#swagger.parameters['$ref'] = [
62+
'#/components/parameters/apiEntityHeader',
63+
'#/components/parameters/apiUserHeader',
64+
'#/components/parameters/apiSecretHeader'
65+
]
6166
#swagger.parameters['shortname'] = {
6267
description: 'The shortname of the organization'
6368
}
6469
#swagger.parameters['username'] = {
6570
description: 'The username of the registry user',
6671
schema: {
6772
type: 'string',
68-
pattern: '^[a-zA-Z0-9._@-]+$' // Based on isValidUsername custom validator
73+
pattern: '^[a-zA-Z0-9._@-]+$'
6974
}
7075
}
71-
#swagger.parameters['$ref'] = [
72-
'#/components/parameters/apiEntityHeader',
73-
'#/components/parameters/apiUserHeader',
74-
'#/components/parameters/apiSecretHeader'
75-
]
7676
#swagger.responses[200] = {
7777
description: 'Returns information about the specified registry user',
7878
content: {

0 commit comments

Comments
 (0)