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,
|
||||
});
|
||||
const maybeAnonymized = this.maybeAnonymise(feature);
|
||||
res.status(200).json(
|
||||
serializeDates({
|
||||
...maybeAnonymized,
|
||||
stale: maybeAnonymized.stale || false,
|
||||
}),
|
||||
const responseData = {
|
||||
...maybeAnonymized,
|
||||
stale: maybeAnonymized.stale || false,
|
||||
};
|
||||
this.openApiService.respondWithValidation(
|
||||
200,
|
||||
res,
|
||||
featureSchema.$id,
|
||||
serializeDates(responseData),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -120,6 +120,20 @@ export const featureEnvironmentSchema = {
|
||||
$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: {
|
||||
schemas: {
|
||||
|
||||
@ -181,6 +181,13 @@ export const featureSchema = {
|
||||
],
|
||||
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: {
|
||||
description: 'When the feature entered this stage',
|
||||
type: 'string',
|
||||
@ -281,6 +288,12 @@ export const featureSchema = {
|
||||
description: 'The description of the link',
|
||||
nullable: true,
|
||||
},
|
||||
feature: {
|
||||
type: 'string',
|
||||
example: 'disable-comments',
|
||||
description:
|
||||
'The name of the feature this link belongs to',
|
||||
},
|
||||
},
|
||||
},
|
||||
description:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user