1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix: add missing environments field to uiConfigSchema (#1736)

* fix: add missing environment field to uiConfigSchema

* refactor: avoid throwing when unleash-server is a dependency in dev mode
This commit is contained in:
olav 2022-06-21 09:34:07 +02:00 committed by GitHub
parent 32399291e0
commit 7ee8892704
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 5 deletions

View File

@ -7,6 +7,7 @@ test('uiConfigSchema', () => {
version: 'a',
unleashUrl: 'a',
baseUriPath: 'a',
environment: 'a',
disablePasswordAuth: false,
segmentValuesLimit: 0,
strategySegmentsLimit: 0,

View File

@ -24,6 +24,9 @@ export const uiConfigSchema = {
version: {
type: 'string',
},
environment: {
type: 'string',
},
unleashUrl: {
type: 'string',
},

View File

@ -77,11 +77,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);

View File

@ -1052,6 +1052,9 @@ Object {
"disablePasswordAuth": Object {
"type": "boolean",
},
"environment": Object {
"type": "string",
},
"flags": Object {
"additionalProperties": Object {
"type": "boolean",