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',
|
version: 'a',
|
||||||
unleashUrl: 'a',
|
unleashUrl: 'a',
|
||||||
baseUriPath: 'a',
|
baseUriPath: 'a',
|
||||||
|
environment: 'a',
|
||||||
disablePasswordAuth: false,
|
disablePasswordAuth: false,
|
||||||
segmentValuesLimit: 0,
|
segmentValuesLimit: 0,
|
||||||
strategySegmentsLimit: 0,
|
strategySegmentsLimit: 0,
|
||||||
|
@ -24,6 +24,9 @@ export const uiConfigSchema = {
|
|||||||
version: {
|
version: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
},
|
},
|
||||||
|
environment: {
|
||||||
|
type: 'string',
|
||||||
|
},
|
||||||
unleashUrl: {
|
unleashUrl: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
},
|
},
|
||||||
|
@ -77,11 +77,7 @@ export class OpenApiService {
|
|||||||
const errors = validateSchema(schema, data);
|
const errors = validateSchema(schema, data);
|
||||||
|
|
||||||
if (errors) {
|
if (errors) {
|
||||||
if (process.env.NODE_ENV === 'development') {
|
this.logger.warn('Invalid response:', errors);
|
||||||
throw new Error(JSON.stringify(errors, null, 2));
|
|
||||||
} else {
|
|
||||||
this.logger.warn('Invalid response:', errors);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
res.status(status).json(data);
|
res.status(status).json(data);
|
||||||
|
@ -1052,6 +1052,9 @@ Object {
|
|||||||
"disablePasswordAuth": Object {
|
"disablePasswordAuth": Object {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
},
|
},
|
||||||
|
"environment": Object {
|
||||||
|
"type": "string",
|
||||||
|
},
|
||||||
"flags": Object {
|
"flags": Object {
|
||||||
"additionalProperties": Object {
|
"additionalProperties": Object {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
|
Loading…
Reference in New Issue
Block a user