mirror of
https://github.com/Unleash/unleash.git
synced 2025-05-17 01:17:29 +02:00
docs: OpenAPI Client tag (#3979)
### What Adds documentation for open api endpoints tagged with `Client`. --------- Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
This commit is contained in:
parent
6ae4fe2085
commit
b8da1ce2a9
@ -93,10 +93,6 @@ const metaRules: Rule[] = [
|
||||
'batchFeaturesSchema',
|
||||
'batchStaleSchema',
|
||||
'changePasswordSchema',
|
||||
'clientApplicationSchema',
|
||||
'clientFeatureSchema',
|
||||
'clientFeaturesQuerySchema',
|
||||
'clientFeaturesSchema',
|
||||
'cloneFeatureSchema',
|
||||
'contextFieldSchema',
|
||||
'createApiTokenSchema',
|
||||
@ -129,7 +125,6 @@ const metaRules: Rule[] = [
|
||||
'toggleMaintenanceSchema',
|
||||
'meSchema',
|
||||
'nameSchema',
|
||||
'overrideSchema',
|
||||
'passwordSchema',
|
||||
'patchSchema',
|
||||
'permissionSchema',
|
||||
@ -167,7 +162,6 @@ const metaRules: Rule[] = [
|
||||
'validateEdgeTokensSchema',
|
||||
'validatePasswordSchema',
|
||||
'validateTagTypeSchema',
|
||||
'variantSchema',
|
||||
'variantFlagSchema',
|
||||
'versionSchema',
|
||||
'projectOverviewSchema',
|
||||
@ -192,10 +186,6 @@ const metaRules: Rule[] = [
|
||||
'batchFeaturesSchema',
|
||||
'batchStaleSchema',
|
||||
'changePasswordSchema',
|
||||
'clientApplicationSchema',
|
||||
'clientFeatureSchema',
|
||||
'clientFeaturesQuerySchema',
|
||||
'clientFeaturesSchema',
|
||||
'cloneFeatureSchema',
|
||||
'contextFieldSchema',
|
||||
'contextFieldsSchema',
|
||||
@ -229,7 +219,6 @@ const metaRules: Rule[] = [
|
||||
'toggleMaintenanceSchema',
|
||||
'meSchema',
|
||||
'nameSchema',
|
||||
'overrideSchema',
|
||||
'parametersSchema',
|
||||
'passwordSchema',
|
||||
'patchesSchema',
|
||||
@ -270,7 +259,6 @@ const metaRules: Rule[] = [
|
||||
'validateEdgeTokensSchema',
|
||||
'validatePasswordSchema',
|
||||
'validateTagTypeSchema',
|
||||
'variantSchema',
|
||||
'variantFlagSchema',
|
||||
'variantsSchema',
|
||||
'versionSchema',
|
||||
|
@ -4,33 +4,55 @@ export const clientApplicationSchema = {
|
||||
$id: '#/components/schemas/clientApplicationSchema',
|
||||
type: 'object',
|
||||
required: ['appName', 'interval', 'started', 'strategies'],
|
||||
description: 'A client application is an instance of one of our SDKs',
|
||||
properties: {
|
||||
appName: {
|
||||
description:
|
||||
'An identifier for the app that uses the sdk, should be static across SDK restarts',
|
||||
type: 'string',
|
||||
example: 'example-app',
|
||||
},
|
||||
instanceId: {
|
||||
description:
|
||||
'A unique identifier identifying the instance of the application running the SDK. Often changes based on execution environment. For instance: two pods in Kubernetes will have two different instanceIds',
|
||||
type: 'string',
|
||||
example: 'b77f3d13-5f48-4a7b-a3f4-a449b97ce43a',
|
||||
},
|
||||
sdkVersion: {
|
||||
type: 'string',
|
||||
description:
|
||||
'An SDK version identifier. Usually formatted as "unleash-client-<language>:<version>"',
|
||||
example: 'unleash-client-java:7.0.0',
|
||||
},
|
||||
environment: {
|
||||
description: `The SDK's configured 'environment' property. Deprecated. This property does **not** control which Unleash environment the SDK gets toggles for. To control Unleash environments, use the SDKs API key.`,
|
||||
deprecated: true,
|
||||
type: 'string',
|
||||
example: 'development',
|
||||
},
|
||||
interval: {
|
||||
type: 'number',
|
||||
description:
|
||||
'How often (in seconds) does the client refresh its toggles',
|
||||
example: 10,
|
||||
minimum: 0,
|
||||
},
|
||||
started: {
|
||||
description:
|
||||
'Either an RFC-3339 timestamp or a unix timestamp in seconds',
|
||||
oneOf: [
|
||||
{ type: 'string', format: 'date-time' },
|
||||
{ type: 'number' },
|
||||
],
|
||||
example: '2023-06-13T16:35:00.000Z',
|
||||
},
|
||||
strategies: {
|
||||
description: 'Which strategies the SDKs runtime knows about',
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
example: ['default', 'gradualRollout', 'remoteAddress'],
|
||||
},
|
||||
},
|
||||
components: {},
|
||||
|
@ -9,55 +9,68 @@ export const clientFeatureSchema = {
|
||||
$id: '#/components/schemas/clientFeatureSchema',
|
||||
type: 'object',
|
||||
required: ['name', 'enabled'],
|
||||
description:
|
||||
'Feature toggle configuration used by SDKs to evaluate state of a toggle',
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
name: {
|
||||
type: 'string',
|
||||
description:
|
||||
'The unique name of a feature toggle. Is validated to be URL safe on creation',
|
||||
example: 'new.payment.flow.stripe',
|
||||
},
|
||||
type: {
|
||||
type: 'string',
|
||||
description:
|
||||
'What kind of feature flag is this. Refer to the documentation on [feature toggle types](https://docs.getunleash.io/reference/feature-toggle-types) for more information',
|
||||
example: 'release',
|
||||
},
|
||||
description: {
|
||||
type: 'string',
|
||||
description: 'A description of the toggle',
|
||||
nullable: true,
|
||||
},
|
||||
createdAt: {
|
||||
type: 'string',
|
||||
format: 'date-time',
|
||||
nullable: true,
|
||||
},
|
||||
lastSeenAt: {
|
||||
type: 'string',
|
||||
format: 'date-time',
|
||||
nullable: true,
|
||||
example: 'No variants here',
|
||||
},
|
||||
enabled: {
|
||||
type: 'boolean',
|
||||
description:
|
||||
'Whether the feature flag is enabled for the current API key or not. This is ANDed with the evaluation results of the strategies list, so if this is false, the evaluation result will always be false',
|
||||
example: true,
|
||||
},
|
||||
stale: {
|
||||
description:
|
||||
'If this is true Unleash believes this feature toggle has been active longer than Unleash expects a toggle of this type to be active',
|
||||
type: 'boolean',
|
||||
example: false,
|
||||
},
|
||||
impressionData: {
|
||||
description:
|
||||
'Set to true if SDKs should trigger [impression events](https://docs.getunleash.io/reference/impression-data) when this toggle is evaluated',
|
||||
type: 'boolean',
|
||||
nullable: true,
|
||||
example: false,
|
||||
},
|
||||
project: {
|
||||
description: 'Which project this feature toggle belongs to',
|
||||
type: 'string',
|
||||
example: 'new.payment.flow',
|
||||
},
|
||||
strategies: {
|
||||
type: 'array',
|
||||
description:
|
||||
'Evaluation strategies for this toggle. Each entry in this list will be evaluated and ORed together',
|
||||
items: {
|
||||
$ref: '#/components/schemas/featureStrategySchema',
|
||||
},
|
||||
deprecated: true,
|
||||
},
|
||||
variants: {
|
||||
type: 'array',
|
||||
description:
|
||||
'[Variants](https://docs.getunleash.io/reference/feature-toggle-variants#what-are-variants) configured for this toggle',
|
||||
items: {
|
||||
$ref: '#/components/schemas/variantSchema',
|
||||
},
|
||||
nullable: true,
|
||||
deprecated: true,
|
||||
},
|
||||
},
|
||||
components: {
|
||||
|
@ -4,30 +4,46 @@ export const clientFeaturesQuerySchema = {
|
||||
$id: '#/components/schemas/clientFeaturesQuerySchema',
|
||||
type: 'object',
|
||||
additionalProperties: false,
|
||||
description: 'Query parameters active for a client features request',
|
||||
properties: {
|
||||
tag: {
|
||||
type: 'array',
|
||||
description: 'Features tagged with one of these tags are included',
|
||||
items: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
example: [['simple:payment', 'simple:stripejourney']],
|
||||
},
|
||||
project: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
description:
|
||||
'Features that are part of these projects are included in this response. (DEPRECATED) - Handled by API tokens',
|
||||
example: ['new.payment.flow'],
|
||||
deprecated: true,
|
||||
},
|
||||
namePrefix: {
|
||||
description:
|
||||
'Features are filtered to only include features whose name starts with this prefix',
|
||||
type: 'string',
|
||||
example: 'payment',
|
||||
},
|
||||
environment: {
|
||||
type: 'string',
|
||||
description:
|
||||
'Strategies for the feature toggle configured for this environment are included. (DEPRECATED) - Handled by API tokens',
|
||||
deprecated: true,
|
||||
},
|
||||
inlineSegmentConstraints: {
|
||||
description:
|
||||
'Set to true if requesting client does not support Unleash-Client-Specification 4.2.2 or newer. Modern SDKs will have this set to false, since they will be able to merge constraints and segments themselves',
|
||||
type: 'boolean',
|
||||
example: true,
|
||||
},
|
||||
},
|
||||
components: {},
|
||||
|
@ -20,7 +20,7 @@ test('clientFeaturesSchema required fields', () => {
|
||||
{
|
||||
name: 'a',
|
||||
weight: 1,
|
||||
weightType: 'b',
|
||||
weightType: 'fix',
|
||||
stickiness: 'c',
|
||||
payload: {
|
||||
type: 'a',
|
||||
@ -50,7 +50,6 @@ test('clientFeaturesSchema java-sdk expected response', () => {
|
||||
{
|
||||
"id": 1,
|
||||
"name": "some-name",
|
||||
"description": null,
|
||||
"constraints": [
|
||||
{
|
||||
"contextName": "some-name",
|
||||
@ -65,19 +64,16 @@ test('clientFeaturesSchema java-sdk expected response', () => {
|
||||
"features": [
|
||||
{
|
||||
"name": "Test.old",
|
||||
"description": "No variants here!",
|
||||
"enabled": true,
|
||||
"strategies": [
|
||||
{
|
||||
"name": "default"
|
||||
}
|
||||
],
|
||||
"variants": null,
|
||||
"createdAt": "2019-01-24T10:38:10.370Z"
|
||||
"variants": null
|
||||
},
|
||||
{
|
||||
"name": "Test.variants",
|
||||
"description": null,
|
||||
"enabled": true,
|
||||
"strategies": [
|
||||
{
|
||||
@ -96,8 +92,7 @@ test('clientFeaturesSchema java-sdk expected response', () => {
|
||||
"name": "variant2",
|
||||
"weight": 50
|
||||
}
|
||||
],
|
||||
"createdAt": "2019-01-24T10:41:45.236Z"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "featureX",
|
||||
@ -178,8 +173,7 @@ test('clientFeaturesSchema unleash-proxy expected response', () => {
|
||||
"name": "default"
|
||||
}
|
||||
],
|
||||
"variants": null,
|
||||
"createdAt": "2019-01-24T10:38:10.370Z"
|
||||
"variants": null
|
||||
},
|
||||
{
|
||||
"name": "Test.variants",
|
||||
@ -202,8 +196,7 @@ test('clientFeaturesSchema unleash-proxy expected response', () => {
|
||||
"name": "variant2",
|
||||
"weight": 50
|
||||
}
|
||||
],
|
||||
"createdAt": "2019-01-24T10:41:45.236Z"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "featureX",
|
||||
|
@ -13,23 +13,34 @@ export const clientFeaturesSchema = {
|
||||
$id: '#/components/schemas/clientFeaturesSchema',
|
||||
type: 'object',
|
||||
required: ['version', 'features'],
|
||||
description:
|
||||
'Configuration data for server-side SDKs for evaluating feature flags.',
|
||||
properties: {
|
||||
version: {
|
||||
type: 'number',
|
||||
description:
|
||||
'A version number for the format used in the response. Most Unleash instances now return version 2, which includes segments as a separate array',
|
||||
example: 2,
|
||||
minimum: 0,
|
||||
},
|
||||
features: {
|
||||
description: 'A list of feature toggles with their configuration',
|
||||
type: 'array',
|
||||
items: {
|
||||
$ref: '#/components/schemas/clientFeatureSchema',
|
||||
},
|
||||
},
|
||||
segments: {
|
||||
description:
|
||||
'A list of [Segments](https://docs.getunleash.io/reference/segments) configured for this Unleash instance',
|
||||
type: 'array',
|
||||
items: {
|
||||
$ref: '#/components/schemas/segmentSchema',
|
||||
},
|
||||
},
|
||||
query: {
|
||||
description:
|
||||
'A summary of filters and parameters sent to the endpoint. Used by the server to build the features and segments response',
|
||||
$ref: '#/components/schemas/clientFeaturesQuerySchema',
|
||||
},
|
||||
},
|
||||
|
@ -8,7 +8,7 @@ test('featureSchema', () => {
|
||||
{
|
||||
name: 'a',
|
||||
weight: 1,
|
||||
weightType: 'a',
|
||||
weightType: 'fix',
|
||||
stickiness: 'a',
|
||||
overrides: [{ contextName: 'a', values: ['a'] }],
|
||||
payload: { type: 'a', value: 'b' },
|
||||
|
@ -5,7 +5,7 @@ import { parametersSchema } from './parameters-schema';
|
||||
export const featureStrategySchema = {
|
||||
$id: '#/components/schemas/featureStrategySchema',
|
||||
description:
|
||||
'A singles activation strategy configuration schema for a feature',
|
||||
'A single activation strategy configuration schema for a feature',
|
||||
type: 'object',
|
||||
additionalProperties: false,
|
||||
required: ['name'],
|
||||
|
@ -5,15 +5,22 @@ export const overrideSchema = {
|
||||
type: 'object',
|
||||
additionalProperties: false,
|
||||
required: ['contextName', 'values'],
|
||||
description:
|
||||
'An override for deciding which variant should be assigned to a user based on the context name',
|
||||
properties: {
|
||||
contextName: {
|
||||
description:
|
||||
'The name of the context field used to determine overrides',
|
||||
type: 'string',
|
||||
example: 'userId',
|
||||
},
|
||||
values: {
|
||||
description: 'Which values that should be overriden',
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
example: ['red', 'blue'],
|
||||
},
|
||||
},
|
||||
components: {},
|
||||
|
@ -5,23 +5,38 @@ export const variantSchema = {
|
||||
$id: '#/components/schemas/variantSchema',
|
||||
type: 'object',
|
||||
additionalProperties: false,
|
||||
description:
|
||||
'A variant allows for further separation of users into segments. See [our excellent documentation](https://docs.getunleash.io/reference/feature-toggle-variants#what-are-variants) for a more detailed description',
|
||||
required: ['name', 'weight'],
|
||||
properties: {
|
||||
name: {
|
||||
type: 'string',
|
||||
description: 'The variants name. Is unique for this feature toggle',
|
||||
example: 'blue_group',
|
||||
},
|
||||
weight: {
|
||||
type: 'number',
|
||||
description:
|
||||
'The weight is the likelihood of any one user getting this variant. It is a number between 0 and 1000. See the section on [variant weights](https://docs.getunleash.io/reference/feature-toggle-variants#variant-weight) for more information',
|
||||
minimum: 0,
|
||||
maximum: 1000,
|
||||
},
|
||||
weightType: {
|
||||
description:
|
||||
'Set to fix if this variant must have exactly the weight allocated to it. If the type is variable, the weight will adjust so that the total weight of all variants adds up to 1000',
|
||||
type: 'string',
|
||||
example: 'fix',
|
||||
},
|
||||
stickiness: {
|
||||
type: 'string',
|
||||
description:
|
||||
'[Stickiness](https://docs.getunleash.io/reference/feature-toggle-variants#variant-stickiness) is how Unleash guarantees that the same user gets the same variant every time',
|
||||
example: 'custom.context.field',
|
||||
},
|
||||
payload: {
|
||||
type: 'object',
|
||||
required: ['type', 'value'],
|
||||
description: 'Extra data configured for this variant',
|
||||
properties: {
|
||||
type: {
|
||||
type: 'string',
|
||||
@ -30,8 +45,10 @@ export const variantSchema = {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
example: { type: 'json', value: '{color: red}' },
|
||||
},
|
||||
overrides: {
|
||||
description: `Overrides assigning specific variants to specific users. The weighting system automatically assigns users to specific groups for you, but any overrides in this list will take precedence.`,
|
||||
type: 'array',
|
||||
items: {
|
||||
$ref: '#/components/schemas/overrideSchema',
|
||||
|
@ -94,6 +94,9 @@ export default class FeatureController extends Controller {
|
||||
middleware: [
|
||||
openApiService.validPath({
|
||||
operationId: 'getClientFeature',
|
||||
summary: 'Get a single feature toggle',
|
||||
description:
|
||||
'Gets all the client data for a single toggle. Contains the exact same information about a toggle as the `/api/client/features` endpoint does, but only contains data about the specified toggle. All SDKs should use `/api/client/features`',
|
||||
tags: ['Client'],
|
||||
responses: {
|
||||
200: createResponseSchema('clientFeatureSchema'),
|
||||
@ -109,6 +112,9 @@ export default class FeatureController extends Controller {
|
||||
permission: NONE,
|
||||
middleware: [
|
||||
openApiService.validPath({
|
||||
summary: 'Get all toggles (SDK)',
|
||||
description:
|
||||
'Returns the SDK configuration for all feature toggles that are available to the provided API key. Used by SDKs to configure local evaluation',
|
||||
operationId: 'getAllClientFeatures',
|
||||
tags: ['Client'],
|
||||
responses: {
|
||||
|
@ -51,6 +51,8 @@ export default class ClientMetricsController extends Controller {
|
||||
middleware: [
|
||||
openApiService.validPath({
|
||||
tags: ['Client'],
|
||||
summary: 'Register client usage metrics',
|
||||
description: `Registers usage metrics. Stores information about how many times each toggle was evaluated to enabled and disabled within a time frame. If provided, this operation will also store data on how many times each feature toggle's variants were displayed to the end user.`,
|
||||
operationId: 'registerClientMetrics',
|
||||
requestBody: createRequestSchema('clientMetricsSchema'),
|
||||
responses: {
|
||||
|
@ -41,6 +41,9 @@ export default class RegisterController extends Controller {
|
||||
middleware: [
|
||||
openApiService.validPath({
|
||||
tags: ['Client'],
|
||||
summary: 'Register a client SDK',
|
||||
description:
|
||||
'Register a client SDK with Unleash. SDKs call this endpoint on startup to tell Unleash about their existence. Used to track custom strategies in use as well as SDK versions.',
|
||||
operationId: 'registerClientApplication',
|
||||
requestBody: createRequestSchema('clientApplicationSchema'),
|
||||
responses: { 202: emptyResponse },
|
||||
|
@ -1239,23 +1239,38 @@ The provider you choose for your addon dictates what properties the \`parameters
|
||||
"type": "object",
|
||||
},
|
||||
"clientApplicationSchema": {
|
||||
"description": "A client application is an instance of one of our SDKs",
|
||||
"properties": {
|
||||
"appName": {
|
||||
"description": "An identifier for the app that uses the sdk, should be static across SDK restarts",
|
||||
"example": "example-app",
|
||||
"type": "string",
|
||||
},
|
||||
"environment": {
|
||||
"deprecated": true,
|
||||
"description": "The SDK's configured 'environment' property. Deprecated. This property does **not** control which Unleash environment the SDK gets toggles for. To control Unleash environments, use the SDKs API key.",
|
||||
"example": "development",
|
||||
"type": "string",
|
||||
},
|
||||
"instanceId": {
|
||||
"description": "A unique identifier identifying the instance of the application running the SDK. Often changes based on execution environment. For instance: two pods in Kubernetes will have two different instanceIds",
|
||||
"example": "b77f3d13-5f48-4a7b-a3f4-a449b97ce43a",
|
||||
"type": "string",
|
||||
},
|
||||
"interval": {
|
||||
"description": "How often (in seconds) does the client refresh its toggles",
|
||||
"example": 10,
|
||||
"minimum": 0,
|
||||
"type": "number",
|
||||
},
|
||||
"sdkVersion": {
|
||||
"description": "An SDK version identifier. Usually formatted as "unleash-client-<language>:<version>"",
|
||||
"example": "unleash-client-java:7.0.0",
|
||||
"type": "string",
|
||||
},
|
||||
"started": {
|
||||
"description": "Either an RFC-3339 timestamp or a unix timestamp in seconds",
|
||||
"example": "2023-06-13T16:35:00.000Z",
|
||||
"oneOf": [
|
||||
{
|
||||
"format": "date-time",
|
||||
@ -1267,6 +1282,12 @@ The provider you choose for your addon dictates what properties the \`parameters
|
||||
],
|
||||
},
|
||||
"strategies": {
|
||||
"description": "Which strategies the SDKs runtime knows about",
|
||||
"example": [
|
||||
"default",
|
||||
"gradualRollout",
|
||||
"remoteAddress",
|
||||
],
|
||||
"items": {
|
||||
"type": "string",
|
||||
},
|
||||
@ -1283,49 +1304,54 @@ The provider you choose for your addon dictates what properties the \`parameters
|
||||
},
|
||||
"clientFeatureSchema": {
|
||||
"additionalProperties": false,
|
||||
"description": "Feature toggle configuration used by SDKs to evaluate state of a toggle",
|
||||
"properties": {
|
||||
"createdAt": {
|
||||
"format": "date-time",
|
||||
"nullable": true,
|
||||
"type": "string",
|
||||
},
|
||||
"description": {
|
||||
"description": "A description of the toggle",
|
||||
"example": "No variants here",
|
||||
"nullable": true,
|
||||
"type": "string",
|
||||
},
|
||||
"enabled": {
|
||||
"description": "Whether the feature flag is enabled for the current API key or not. This is ANDed with the evaluation results of the strategies list, so if this is false, the evaluation result will always be false",
|
||||
"example": true,
|
||||
"type": "boolean",
|
||||
},
|
||||
"impressionData": {
|
||||
"description": "Set to true if SDKs should trigger [impression events](https://docs.getunleash.io/reference/impression-data) when this toggle is evaluated",
|
||||
"example": false,
|
||||
"nullable": true,
|
||||
"type": "boolean",
|
||||
},
|
||||
"lastSeenAt": {
|
||||
"format": "date-time",
|
||||
"nullable": true,
|
||||
"type": "string",
|
||||
},
|
||||
"name": {
|
||||
"description": "The unique name of a feature toggle. Is validated to be URL safe on creation",
|
||||
"example": "new.payment.flow.stripe",
|
||||
"type": "string",
|
||||
},
|
||||
"project": {
|
||||
"description": "Which project this feature toggle belongs to",
|
||||
"example": "new.payment.flow",
|
||||
"type": "string",
|
||||
},
|
||||
"stale": {
|
||||
"description": "If this is true Unleash believes this feature toggle has been active longer than Unleash expects a toggle of this type to be active",
|
||||
"example": false,
|
||||
"type": "boolean",
|
||||
},
|
||||
"strategies": {
|
||||
"deprecated": true,
|
||||
"description": "Evaluation strategies for this toggle. Each entry in this list will be evaluated and ORed together",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/featureStrategySchema",
|
||||
},
|
||||
"type": "array",
|
||||
},
|
||||
"type": {
|
||||
"description": "What kind of feature flag is this. Refer to the documentation on [feature toggle types](https://docs.getunleash.io/reference/feature-toggle-types) for more information",
|
||||
"example": "release",
|
||||
"type": "string",
|
||||
},
|
||||
"variants": {
|
||||
"deprecated": true,
|
||||
"description": "[Variants](https://docs.getunleash.io/reference/feature-toggle-variants#what-are-variants) configured for this toggle",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/variantSchema",
|
||||
},
|
||||
@ -1341,23 +1367,42 @@ The provider you choose for your addon dictates what properties the \`parameters
|
||||
},
|
||||
"clientFeaturesQuerySchema": {
|
||||
"additionalProperties": false,
|
||||
"description": "Query parameters active for a client features request",
|
||||
"properties": {
|
||||
"environment": {
|
||||
"deprecated": true,
|
||||
"description": "Strategies for the feature toggle configured for this environment are included. (DEPRECATED) - Handled by API tokens",
|
||||
"type": "string",
|
||||
},
|
||||
"inlineSegmentConstraints": {
|
||||
"description": "Set to true if requesting client does not support Unleash-Client-Specification 4.2.2 or newer. Modern SDKs will have this set to false, since they will be able to merge constraints and segments themselves",
|
||||
"example": true,
|
||||
"type": "boolean",
|
||||
},
|
||||
"namePrefix": {
|
||||
"description": "Features are filtered to only include features whose name starts with this prefix",
|
||||
"example": "payment",
|
||||
"type": "string",
|
||||
},
|
||||
"project": {
|
||||
"deprecated": true,
|
||||
"description": "Features that are part of these projects are included in this response. (DEPRECATED) - Handled by API tokens",
|
||||
"example": [
|
||||
"new.payment.flow",
|
||||
],
|
||||
"items": {
|
||||
"type": "string",
|
||||
},
|
||||
"type": "array",
|
||||
},
|
||||
"tag": {
|
||||
"description": "Features tagged with one of these tags are included",
|
||||
"example": [
|
||||
[
|
||||
"simple:payment",
|
||||
"simple:stripejourney",
|
||||
],
|
||||
],
|
||||
"items": {
|
||||
"items": {
|
||||
"type": "string",
|
||||
@ -1370,8 +1415,10 @@ The provider you choose for your addon dictates what properties the \`parameters
|
||||
"type": "object",
|
||||
},
|
||||
"clientFeaturesSchema": {
|
||||
"description": "Configuration data for server-side SDKs for evaluating feature flags.",
|
||||
"properties": {
|
||||
"features": {
|
||||
"description": "A list of feature toggles with their configuration",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/clientFeatureSchema",
|
||||
},
|
||||
@ -1379,14 +1426,19 @@ The provider you choose for your addon dictates what properties the \`parameters
|
||||
},
|
||||
"query": {
|
||||
"$ref": "#/components/schemas/clientFeaturesQuerySchema",
|
||||
"description": "A summary of filters and parameters sent to the endpoint. Used by the server to build the features and segments response",
|
||||
},
|
||||
"segments": {
|
||||
"description": "A list of [Segments](https://docs.getunleash.io/reference/segments) configured for this Unleash instance",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/segmentSchema",
|
||||
},
|
||||
"type": "array",
|
||||
},
|
||||
"version": {
|
||||
"description": "A version number for the format used in the response. Most Unleash instances now return version 2, which includes segments as a separate array",
|
||||
"example": 2,
|
||||
"minimum": 0,
|
||||
"type": "number",
|
||||
},
|
||||
},
|
||||
@ -2633,7 +2685,7 @@ The provider you choose for your addon dictates what properties the \`parameters
|
||||
},
|
||||
"featureStrategySchema": {
|
||||
"additionalProperties": false,
|
||||
"description": "A singles activation strategy configuration schema for a feature",
|
||||
"description": "A single activation strategy configuration schema for a feature",
|
||||
"properties": {
|
||||
"constraints": {
|
||||
"description": "A list of the constraints attached to the strategy",
|
||||
@ -3502,11 +3554,19 @@ The provider you choose for your addon dictates what properties the \`parameters
|
||||
},
|
||||
"overrideSchema": {
|
||||
"additionalProperties": false,
|
||||
"description": "An override for deciding which variant should be assigned to a user based on the context name",
|
||||
"properties": {
|
||||
"contextName": {
|
||||
"description": "The name of the context field used to determine overrides",
|
||||
"example": "userId",
|
||||
"type": "string",
|
||||
},
|
||||
"values": {
|
||||
"description": "Which values that should be overriden",
|
||||
"example": [
|
||||
"red",
|
||||
"blue",
|
||||
],
|
||||
"items": {
|
||||
"type": "string",
|
||||
},
|
||||
@ -5797,17 +5857,26 @@ Stats are divided into current and previous **windows**.
|
||||
},
|
||||
"variantSchema": {
|
||||
"additionalProperties": false,
|
||||
"description": "A variant allows for further separation of users into segments. See [our excellent documentation](https://docs.getunleash.io/reference/feature-toggle-variants#what-are-variants) for a more detailed description",
|
||||
"properties": {
|
||||
"name": {
|
||||
"description": "The variants name. Is unique for this feature toggle",
|
||||
"example": "blue_group",
|
||||
"type": "string",
|
||||
},
|
||||
"overrides": {
|
||||
"description": "Overrides assigning specific variants to specific users. The weighting system automatically assigns users to specific groups for you, but any overrides in this list will take precedence.",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/overrideSchema",
|
||||
},
|
||||
"type": "array",
|
||||
},
|
||||
"payload": {
|
||||
"description": "Extra data configured for this variant",
|
||||
"example": {
|
||||
"type": "json",
|
||||
"value": "{color: red}",
|
||||
},
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
@ -5823,12 +5892,19 @@ Stats are divided into current and previous **windows**.
|
||||
"type": "object",
|
||||
},
|
||||
"stickiness": {
|
||||
"description": "[Stickiness](https://docs.getunleash.io/reference/feature-toggle-variants#variant-stickiness) is how Unleash guarantees that the same user gets the same variant every time",
|
||||
"example": "custom.context.field",
|
||||
"type": "string",
|
||||
},
|
||||
"weight": {
|
||||
"description": "The weight is the likelihood of any one user getting this variant. It is a number between 0 and 1000. See the section on [variant weights](https://docs.getunleash.io/reference/feature-toggle-variants#variant-weight) for more information",
|
||||
"maximum": 1000,
|
||||
"minimum": 0,
|
||||
"type": "number",
|
||||
},
|
||||
"weightType": {
|
||||
"description": "Set to fix if this variant must have exactly the weight allocated to it. If the type is variable, the weight will adjust so that the total weight of all variants adds up to 1000",
|
||||
"example": "fix",
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
@ -13692,6 +13768,7 @@ true,false,"[{""range"":""allTime"",""count"":15},{""range"":""30d"",""count"":9
|
||||
},
|
||||
"/api/client/features": {
|
||||
"get": {
|
||||
"description": "Returns the SDK configuration for all feature toggles that are available to the provided API key. Used by SDKs to configure local evaluation",
|
||||
"operationId": "getAllClientFeatures",
|
||||
"responses": {
|
||||
"200": {
|
||||
@ -13705,6 +13782,7 @@ true,false,"[{""range"":""allTime"",""count"":15},{""range"":""30d"",""count"":9
|
||||
"description": "clientFeaturesSchema",
|
||||
},
|
||||
},
|
||||
"summary": "Get all toggles (SDK)",
|
||||
"tags": [
|
||||
"Client",
|
||||
],
|
||||
@ -13712,6 +13790,7 @@ true,false,"[{""range"":""allTime"",""count"":15},{""range"":""30d"",""count"":9
|
||||
},
|
||||
"/api/client/features/{featureName}": {
|
||||
"get": {
|
||||
"description": "Gets all the client data for a single toggle. Contains the exact same information about a toggle as the \`/api/client/features\` endpoint does, but only contains data about the specified toggle. All SDKs should use \`/api/client/features\`",
|
||||
"operationId": "getClientFeature",
|
||||
"parameters": [
|
||||
{
|
||||
@ -13735,6 +13814,7 @@ true,false,"[{""range"":""allTime"",""count"":15},{""range"":""30d"",""count"":9
|
||||
"description": "clientFeatureSchema",
|
||||
},
|
||||
},
|
||||
"summary": "Get a single feature toggle",
|
||||
"tags": [
|
||||
"Client",
|
||||
],
|
||||
@ -13742,6 +13822,7 @@ true,false,"[{""range"":""allTime"",""count"":15},{""range"":""30d"",""count"":9
|
||||
},
|
||||
"/api/client/metrics": {
|
||||
"post": {
|
||||
"description": "Registers usage metrics. Stores information about how many times each toggle was evaluated to enabled and disabled within a time frame. If provided, this operation will also store data on how many times each feature toggle's variants were displayed to the end user.",
|
||||
"operationId": "registerClientMetrics",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
@ -13786,6 +13867,7 @@ true,false,"[{""range"":""allTime"",""count"":15},{""range"":""30d"",""count"":9
|
||||
"description": "The request data does not match what we expect.",
|
||||
},
|
||||
},
|
||||
"summary": "Register client usage metrics",
|
||||
"tags": [
|
||||
"Client",
|
||||
],
|
||||
@ -13793,6 +13875,7 @@ true,false,"[{""range"":""allTime"",""count"":15},{""range"":""30d"",""count"":9
|
||||
},
|
||||
"/api/client/register": {
|
||||
"post": {
|
||||
"description": "Register a client SDK with Unleash. SDKs call this endpoint on startup to tell Unleash about their existence. Used to track custom strategies in use as well as SDK versions.",
|
||||
"operationId": "registerClientApplication",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
@ -13810,6 +13893,7 @@ true,false,"[{""range"":""allTime"",""count"":15},{""range"":""30d"",""count"":9
|
||||
"description": "This response has no body.",
|
||||
},
|
||||
},
|
||||
"summary": "Register a client SDK",
|
||||
"tags": [
|
||||
"Client",
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user