Skip to content

Commit

Permalink
feat: deprecate state api (#3551)
Browse files Browse the repository at this point in the history
## About the changes
This deprecates state API in favor of the new batch import/export
  • Loading branch information
gastonfournier committed Apr 18, 2023
1 parent 8840b43 commit 008d9b8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/lib/openapi/meta-schema-rules.test.ts
Expand Up @@ -278,7 +278,6 @@ const metaRules: Rule[] = [
'setUiConfigSchema',
'sortOrderSchema',
'splashSchema',
'stateSchema',
'strategiesSchema',
'tagTypeSchema',
'tagTypesSchema',
Expand Down
3 changes: 3 additions & 0 deletions src/lib/openapi/spec/state-schema.ts
Expand Up @@ -15,6 +15,9 @@ export const stateSchema = {
$id: '#/components/schemas/stateSchema',
type: 'object',
additionalProperties: true,
deprecated: true,
description:
'The state of the application used by export/import APIs which are deprecated in favor of the more fine grained /api/admin/export and /api/admin/import APIs',
required: ['version'],
properties: {
version: {
Expand Down
8 changes: 8 additions & 0 deletions src/lib/routes/admin-api/state.ts
Expand Up @@ -64,6 +64,10 @@ class StateController extends Controller {
this.openApiService.validPath({
tags: ['Import/Export'],
operationId: 'import',
deprecated: true,
summary: 'Import state (deprecated)',
description:
'Imports state into the system. Deprecated in favor of /api/admin/features-batch/import',
responses: {
202: emptyResponse,
},
Expand All @@ -80,6 +84,10 @@ class StateController extends Controller {
this.openApiService.validPath({
tags: ['Import/Export'],
operationId: 'export',
deprecated: true,
summary: 'Export state (deprecated)',
description:
'Exports the current state of the system. Deprecated in favor of /api/admin/features-batch/export',
responses: {
200: createResponseSchema('stateSchema'),
},
Expand Down
Expand Up @@ -4110,6 +4110,8 @@ Stats are divided into current and previous **windows**.
},
"stateSchema": {
"additionalProperties": true,
"deprecated": true,
"description": "The state of the application used by export/import APIs which are deprecated in favor of the more fine grained /api/admin/export and /api/admin/import APIs",
"properties": {
"environments": {
"items": {
Expand Down Expand Up @@ -8501,6 +8503,8 @@ If the provided project does not exist, the list of events will be empty.",
},
"/api/admin/state/export": {
"get": {
"deprecated": true,
"description": "Exports the current state of the system. Deprecated in favor of /api/admin/features-batch/export",
"operationId": "export",
"parameters": [
{
Expand Down Expand Up @@ -8649,13 +8653,16 @@ If the provided project does not exist, the list of events will be empty.",
"description": "stateSchema",
},
},
"summary": "Export state (deprecated)",
"tags": [
"Import/Export",
],
},
},
"/api/admin/state/import": {
"post": {
"deprecated": true,
"description": "Imports state into the system. Deprecated in favor of /api/admin/features-batch/import",
"operationId": "import",
"requestBody": {
"content": {
Expand All @@ -8673,6 +8680,7 @@ If the provided project does not exist, the list of events will be empty.",
"description": "This response has no body.",
},
},
"summary": "Import state (deprecated)",
"tags": [
"Import/Export",
],
Expand Down

0 comments on commit 008d9b8

Please sign in to comment.