diff --git a/src/lib/openapi/spec/ui-config-schema.test.ts b/src/lib/openapi/spec/ui-config-schema.test.ts index de09f474cd..23ead2a158 100644 --- a/src/lib/openapi/spec/ui-config-schema.test.ts +++ b/src/lib/openapi/spec/ui-config-schema.test.ts @@ -7,6 +7,7 @@ test('uiConfigSchema', () => { version: 'a', unleashUrl: 'a', baseUriPath: 'a', + environment: 'a', disablePasswordAuth: false, segmentValuesLimit: 0, strategySegmentsLimit: 0, diff --git a/src/lib/openapi/spec/ui-config-schema.ts b/src/lib/openapi/spec/ui-config-schema.ts index 8fb15feca7..3a66c4d0ea 100644 --- a/src/lib/openapi/spec/ui-config-schema.ts +++ b/src/lib/openapi/spec/ui-config-schema.ts @@ -24,6 +24,9 @@ export const uiConfigSchema = { version: { type: 'string', }, + environment: { + type: 'string', + }, unleashUrl: { type: 'string', }, diff --git a/src/lib/services/openapi-service.ts b/src/lib/services/openapi-service.ts index 56d1011343..47ff737499 100644 --- a/src/lib/services/openapi-service.ts +++ b/src/lib/services/openapi-service.ts @@ -74,11 +74,7 @@ export class OpenApiService { const errors = validateSchema(schema, data); if (errors) { - if (process.env.NODE_ENV === 'development') { - throw new Error(JSON.stringify(errors, null, 2)); - } else { - this.logger.warn('Invalid response:', errors); - } + this.logger.warn('Invalid response:', errors); } res.status(status).json(data); diff --git a/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap b/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap index de71d5f04a..683c3fe734 100644 --- a/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap +++ b/src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap @@ -787,6 +787,9 @@ Object { "disablePasswordAuth": Object { "type": "boolean", }, + "environment": Object { + "type": "string", + }, "flags": Object { "additionalProperties": Object { "type": "boolean",