mirror of
https://github.com/Unleash/unleash.git
synced 2025-11-24 20:06:55 +01:00
chore: start validating getFeature endpoint (#10975)
This commit is contained in:
parent
06b9d1939b
commit
9de82e87f2
@ -742,11 +742,15 @@ export default class ProjectFeaturesController extends Controller {
|
|||||||
userId: user.id,
|
userId: user.id,
|
||||||
});
|
});
|
||||||
const maybeAnonymized = this.maybeAnonymise(feature);
|
const maybeAnonymized = this.maybeAnonymise(feature);
|
||||||
res.status(200).json(
|
const responseData = {
|
||||||
serializeDates({
|
...maybeAnonymized,
|
||||||
...maybeAnonymized,
|
stale: maybeAnonymized.stale || false,
|
||||||
stale: maybeAnonymized.stale || false,
|
};
|
||||||
}),
|
this.openApiService.respondWithValidation(
|
||||||
|
200,
|
||||||
|
res,
|
||||||
|
featureSchema.$id,
|
||||||
|
serializeDates(responseData),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -120,6 +120,20 @@ export const featureEnvironmentSchema = {
|
|||||||
$ref: '#/components/schemas/releasePlanSchema',
|
$ref: '#/components/schemas/releasePlanSchema',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
yes: {
|
||||||
|
type: 'integer',
|
||||||
|
description:
|
||||||
|
'How many times the feature evaluated to true (enabled)',
|
||||||
|
example: 974,
|
||||||
|
minimum: 0,
|
||||||
|
},
|
||||||
|
no: {
|
||||||
|
type: 'integer',
|
||||||
|
description:
|
||||||
|
'How many times the feature evaluated to false (disabled)',
|
||||||
|
example: 50,
|
||||||
|
minimum: 0,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
schemas: {
|
schemas: {
|
||||||
|
|||||||
@ -181,6 +181,13 @@ export const featureSchema = {
|
|||||||
],
|
],
|
||||||
example: 'initial',
|
example: 'initial',
|
||||||
},
|
},
|
||||||
|
status: {
|
||||||
|
type: 'string',
|
||||||
|
nullable: true,
|
||||||
|
example: 'kept',
|
||||||
|
description:
|
||||||
|
'The name of the detailed status of a given stage. E.g. completed stage can be kept or discarded.',
|
||||||
|
},
|
||||||
enteredStageAt: {
|
enteredStageAt: {
|
||||||
description: 'When the feature entered this stage',
|
description: 'When the feature entered this stage',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
@ -281,6 +288,12 @@ export const featureSchema = {
|
|||||||
description: 'The description of the link',
|
description: 'The description of the link',
|
||||||
nullable: true,
|
nullable: true,
|
||||||
},
|
},
|
||||||
|
feature: {
|
||||||
|
type: 'string',
|
||||||
|
example: 'disable-comments',
|
||||||
|
description:
|
||||||
|
'The name of the feature this link belongs to',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
description:
|
description:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user