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:
parent
32399291e0
commit
7ee8892704
@ -7,6 +7,7 @@ test('uiConfigSchema', () => {
|
||||
version: 'a',
|
||||
unleashUrl: 'a',
|
||||
baseUriPath: 'a',
|
||||
environment: 'a',
|
||||
disablePasswordAuth: false,
|
||||
segmentValuesLimit: 0,
|
||||
strategySegmentsLimit: 0,
|
||||
|
@ -24,6 +24,9 @@ export const uiConfigSchema = {
|
||||
version: {
|
||||
type: 'string',
|
||||
},
|
||||
environment: {
|
||||
type: 'string',
|
||||
},
|
||||
unleashUrl: {
|
||||
type: 'string',
|
||||
},
|
||||
|
@ -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);
|
||||
|
@ -1052,6 +1052,9 @@ Object {
|
||||
"disablePasswordAuth": Object {
|
||||
"type": "boolean",
|
||||
},
|
||||
"environment": Object {
|
||||
"type": "string",
|
||||
},
|
||||
"flags": Object {
|
||||
"additionalProperties": Object {
|
||||
"type": "boolean",
|
||||
|
Loading…
Reference in New Issue
Block a user