Skip to content

Commit

Permalink
chore: backport changes from 4.20 (#3021)
Browse files Browse the repository at this point in the history
## About the changes
Changes included in 4.20 release, mainly improving OpenAPI tags
  • Loading branch information
Gastón Fournier committed Jan 30, 2023
1 parent 751b714 commit 9c21485
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 9 deletions.
15 changes: 15 additions & 0 deletions src/lib/openapi/util/openapi-tags.ts
Expand Up @@ -13,6 +13,11 @@ const OPENAPI_TAGS = [
description:
'Create, update, and delete [Unleash API tokens](https://docs.getunleash.io/reference/api-tokens-and-client-keys).',
},
{
name: 'Personal access tokens',
description:
'Create, update, and delete [Personal access tokens](https://docs.getunleash.io/reference/api-tokens-and-client-keys#personal-access-tokens).',
},
{
name: 'Archive',
description:
Expand Down Expand Up @@ -96,10 +101,20 @@ const OPENAPI_TAGS = [
'Experimental endpoints that may change or disappear at any time.',
},
{ name: 'Edge', description: 'Endpoints related to Unleash on the Edge.' },
{
name: 'Frontend API',
description:
'API for connecting client-side (frontend) applications to Unleash.',
},
{
name: 'Maintenance',
description: 'Enable/disable the maintenance mode of Unleash.',
},
{
name: 'Change Requests',
description:
'API for managing [change requests](https://docs.getunleash.io/reference/change-requests).',
},
] as const;

// make the export mutable, so it can be used in a schema
Expand Down
6 changes: 3 additions & 3 deletions src/lib/routes/admin-api/user/pat.ts
Expand Up @@ -39,7 +39,7 @@ export default class PatController extends Controller {
permission: NONE,
middleware: [
openApiService.validPath({
tags: ['API tokens'],
tags: ['Personal access tokens'],
operationId: 'getPats',
responses: { 200: createResponseSchema('patsSchema') },
}),
Expand All @@ -52,7 +52,7 @@ export default class PatController extends Controller {
permission: NONE,
middleware: [
openApiService.validPath({
tags: ['API tokens'],
tags: ['Personal access tokens'],
operationId: 'createPat',
requestBody: createRequestSchema('patSchema'),
responses: { 200: createResponseSchema('patSchema') },
Expand All @@ -68,7 +68,7 @@ export default class PatController extends Controller {
permission: NONE,
middleware: [
openApiService.validPath({
tags: ['API tokens'],
tags: ['Personal access tokens'],
operationId: 'deletePat',
responses: { 200: emptyResponse },
}),
Expand Down
6 changes: 3 additions & 3 deletions src/lib/routes/proxy-api/index.ts
Expand Up @@ -63,7 +63,7 @@ export default class ProxyController extends Controller {
permission: NONE,
middleware: [
this.services.openApiService.validPath({
tags: ['Unstable'],
tags: ['Frontend API'],
operationId: 'getFrontendFeatures',
responses: {
200: createResponseSchema('proxyFeaturesSchema'),
Expand Down Expand Up @@ -93,7 +93,7 @@ export default class ProxyController extends Controller {
permission: NONE,
middleware: [
this.services.openApiService.validPath({
tags: ['Unstable'],
tags: ['Frontend API'],
operationId: 'registerFrontendMetrics',
requestBody: createRequestSchema('proxyMetricsSchema'),
responses: { 200: emptyResponse },
Expand All @@ -108,7 +108,7 @@ export default class ProxyController extends Controller {
permission: NONE,
middleware: [
this.services.openApiService.validPath({
tags: ['Unstable'],
tags: ['Frontend API'],
operationId: 'registerFrontendClient',
requestBody: createRequestSchema('proxyClientSchema'),
responses: { 200: emptyResponse },
Expand Down
18 changes: 15 additions & 3 deletions src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap
Expand Up @@ -7915,7 +7915,7 @@ If the provided project does not exist, the list of events will be empty.",
},
},
"tags": [
"API tokens",
"Personal access tokens",
],
},
"post": {
Expand Down Expand Up @@ -7944,7 +7944,7 @@ If the provided project does not exist, the list of events will be empty.",
},
},
"tags": [
"API tokens",
"Personal access tokens",
],
},
},
Expand All @@ -7967,7 +7967,7 @@ If the provided project does not exist, the list of events will be empty.",
},
},
"tags": [
"API tokens",
"Personal access tokens",
],
},
},
Expand Down Expand Up @@ -8364,6 +8364,10 @@ If the provided project does not exist, the list of events will be empty.",
"description": "Manage logins, passwords, etc.",
"name": "Auth",
},
{
"description": "API for managing [change requests](https://docs.getunleash.io/reference/change-requests).",
"name": "Change Requests",
},
{
"description": "Endpoints for [Unleash server-side clients](https://docs.getunleash.io/reference/sdks).",
"name": "Client",
Expand All @@ -8388,6 +8392,10 @@ If the provided project does not exist, the list of events will be empty.",
"description": "Create, update, and delete [features toggles](https://docs.getunleash.io/reference/feature-toggles).",
"name": "Features",
},
{
"description": "API for connecting client-side (frontend) applications to Unleash.",
"name": "Frontend API",
},
{
"description": "[Import and export](https://docs.getunleash.io/deploy/import_export) the state of your Unleash instance.",
"name": "Import/Export",
Expand All @@ -8408,6 +8416,10 @@ If the provided project does not exist, the list of events will be empty.",
"description": "Endpoints related to the operational status of this Unleash instance.",
"name": "Operational",
},
{
"description": "Create, update, and delete [Personal access tokens](https://docs.getunleash.io/reference/api-tokens-and-client-keys#personal-access-tokens).",
"name": "Personal access tokens",
},
{
"description": "Evaluate an Unleash context against your feature toggles.",
"name": "Playground",
Expand Down

0 comments on commit 9c21485

Please sign in to comment.