Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
BACKEND CHALLENGES
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Phạm Quang Bảo
BACKEND CHALLENGES
Commits
1bb3e639
Commit
1bb3e639
authored
May 26, 2026
by
Phạm Quang Bảo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: swagger theme
parent
64047a92
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
7 deletions
+18
-7
pnpm-lock.yaml
backend/pnpm-lock.yaml
+4
-4
index.ts
backend/src/controllers/api/v1.0/roles/index.ts
+5
-1
swagger-output.json
backend/src/docs/swagger/swagger-output.json
+6
-0
index.ts
backend/src/index.ts
+2
-2
config.ts
backend/src/templates/swagger/config.ts
+1
-0
No files found.
backend/pnpm-lock.yaml
View file @
1bb3e639
...
@@ -1688,8 +1688,8 @@ packages:
...
@@ -1688,8 +1688,8 @@ packages:
resolution
:
{
integrity
:
sha512-nF7oMeL4KypldrQhac8RyHerJeGPD1p2xDh900GPvc+Nk7nWP6jX2FcC7WmkinMoAmoO774+AFXcWsW8gMWEIg==
}
resolution
:
{
integrity
:
sha512-nF7oMeL4KypldrQhac8RyHerJeGPD1p2xDh900GPvc+Nk7nWP6jX2FcC7WmkinMoAmoO774+AFXcWsW8gMWEIg==
}
engines
:
{
node
:
'
>=10'
}
engines
:
{
node
:
'
>=10'
}
swagger-ui-dist@5.3
2.6
:
swagger-ui-dist@5.3
0.3
:
resolution
:
{
integrity
:
sha512-
75ttZNaYCLoFPnozPZcTUU6mS3wKT8l7WLjU5zJSHFeJa23i5vtnze6IiCl4jDMPeQTXVXIgovq4M11NNfQvSA
==
}
resolution
:
{
integrity
:
sha512-
giQl7/ToPxCqnUAx2wpnSnDNGZtGzw1LyUw6ZitIpTmdrvpxKFY/94v1hihm0zYNpgp1/VY0jTDk//R0BBgnRQ
==
}
swagger-ui-express@5.0.1
:
swagger-ui-express@5.0.1
:
resolution
:
{
integrity
:
sha512-SrNU3RiBGTLLmFU8GIJdOdanJTl4TOmT27tt3bWWHppqYmAZ6IDuEuBvMU6nZq0zLEe6b/1rACXCgLZqO6ZfrA==
}
resolution
:
{
integrity
:
sha512-SrNU3RiBGTLLmFU8GIJdOdanJTl4TOmT27tt3bWWHppqYmAZ6IDuEuBvMU6nZq0zLEe6b/1rACXCgLZqO6ZfrA==
}
...
@@ -3399,14 +3399,14 @@ snapshots:
...
@@ -3399,14 +3399,14 @@ snapshots:
transitivePeerDependencies
:
transitivePeerDependencies
:
-
openapi-types
-
openapi-types
swagger-ui-dist@5.3
2.6
:
swagger-ui-dist@5.3
0.3
:
dependencies
:
dependencies
:
'
@scarf/scarf'
:
1.4.0
'
@scarf/scarf'
:
1.4.0
swagger-ui-express@5.0.1(express@5.2.1)
:
swagger-ui-express@5.0.1(express@5.2.1)
:
dependencies
:
dependencies
:
express
:
5.2.1
express
:
5.2.1
swagger-ui-dist
:
5.3
2.6
swagger-ui-dist
:
5.3
0.3
to-object-path@0.3.0
:
to-object-path@0.3.0
:
dependencies
:
dependencies
:
...
...
backend/src/controllers/api/v1.0/roles/index.ts
View file @
1bb3e639
...
@@ -3,6 +3,8 @@ import { RolesProvider } from "#providers/RolesProvider";
...
@@ -3,6 +3,8 @@ import { RolesProvider } from "#providers/RolesProvider";
import
{
Application
}
from
"express"
;
import
{
Application
}
from
"express"
;
import
{
Resource
}
from
"express-automatic-routes"
;
import
{
Resource
}
from
"express-automatic-routes"
;
import
queryModifier
from
"#middlewares/request"
;
import
queryModifier
from
"#middlewares/request"
;
import
{
authMiddleware
}
from
"#middlewares/authentication"
;
import
{
authorize
}
from
"#middlewares/authorization"
;
export
default
(
_express
:
Application
)
=>
{
export
default
(
_express
:
Application
)
=>
{
const
rolesProvider
=
new
RolesProvider
();
const
rolesProvider
=
new
RolesProvider
();
...
@@ -13,6 +15,8 @@ export default (_express: Application) => {
...
@@ -13,6 +15,8 @@ export default (_express: Application) => {
* /api/v1.0/roles:
* /api/v1.0/roles:
* get:
* get:
* tags: [Roles]
* tags: [Roles]
* security:
* - bearerAuth: []
* parameters:
* parameters:
* - $ref: '#/components/parameters/filters'
* - $ref: '#/components/parameters/filters'
* - $ref: '#/components/parameters/sort'
* - $ref: '#/components/parameters/sort'
...
@@ -27,7 +31,7 @@ export default (_express: Application) => {
...
@@ -27,7 +31,7 @@ export default (_express: Application) => {
* $ref: "#/components/schemas/RoleListResponse"
* $ref: "#/components/schemas/RoleListResponse"
*/
*/
get
:
{
get
:
{
middleware
:
[
queryModifier
],
middleware
:
[
authMiddleware
,
authorize
(
"admin"
),
queryModifier
],
handler
:
async
(
req
:
Req
,
res
:
Res
)
=>
{
handler
:
async
(
req
:
Req
,
res
:
Res
)
=>
{
try
{
try
{
...
...
backend/src/docs/swagger/swagger-output.json
View file @
1bb3e639
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
"openapi"
:
"3.1.0"
,
"openapi"
:
"3.1.0"
,
"info"
:
{
"info"
:
{
"title"
:
"Backend Challenges API"
,
"title"
:
"Backend Challenges API"
,
"description"
:
"Generated API documentation"
,
"version"
:
"1.0.0"
"version"
:
"1.0.0"
},
},
"components"
:
{
"components"
:
{
...
@@ -1700,6 +1701,11 @@
...
@@ -1700,6 +1701,11 @@
"tags"
:
[
"tags"
:
[
"Roles"
"Roles"
],
],
"security"
:
[
{
"bearerAuth"
:
[]
}
],
"parameters"
:
[
"parameters"
:
[
{
{
"$ref"
:
"#/components/parameters/filters"
"$ref"
:
"#/components/parameters/filters"
...
...
backend/src/index.ts
View file @
1bb3e639
...
@@ -7,7 +7,7 @@ import emailCronJob from '#services/schedulerService';
...
@@ -7,7 +7,7 @@ import emailCronJob from '#services/schedulerService';
import
swaggerFile
from
'#docs/swagger/swagger-output.json'
;
import
swaggerFile
from
'#docs/swagger/swagger-output.json'
;
const
app
=
express
()
const
app
=
express
()
const
port
=
300
0
const
port
=
300
1
app
.
use
(
express
.
json
());
app
.
use
(
express
.
json
());
app
.
use
(
response
as
express
.
RequestHandler
);
app
.
use
(
response
as
express
.
RequestHandler
);
...
@@ -21,7 +21,7 @@ mountRoutes(app, {
...
@@ -21,7 +21,7 @@ mountRoutes(app, {
emailCronJob
.
start
();
emailCronJob
.
start
();
app
.
use
(
'/swagger'
,
swaggerUi
.
serve
,
swaggerUi
.
setup
(
swaggerFile
));
app
.
use
(
'/swagger
/index
'
,
swaggerUi
.
serve
,
swaggerUi
.
setup
(
swaggerFile
));
app
.
listen
(
port
,
()
=>
{
app
.
listen
(
port
,
()
=>
{
console
.
log
(
`App listening on port
${
port
}
`
)
console
.
log
(
`App listening on port
${
port
}
`
)
...
...
backend/src/templates/swagger/config.ts
View file @
1bb3e639
...
@@ -17,6 +17,7 @@ const swaggerOptions: Options = {
...
@@ -17,6 +17,7 @@ const swaggerOptions: Options = {
openapi
:
'3.1.0'
,
openapi
:
'3.1.0'
,
info
:
{
info
:
{
title
:
'Backend Challenges API'
,
title
:
'Backend Challenges API'
,
description
:
'Generated API documentation'
,
version
:
'1.0.0'
,
version
:
'1.0.0'
,
},
},
components
:
{
components
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment