1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-05 17:53:12 +02:00

Feat: add "variants" as a required property on playground response

This commit is contained in:
Thomas Heartman 2022-07-19 10:28:56 +02:00
parent cb56846f7f
commit 789b70dcfe
2 changed files with 38 additions and 4 deletions

View File

@ -2,6 +2,7 @@ import { FromSchema } from 'json-schema-to-ts';
import { sdkContextSchema } from './sdk-context-schema';
import { playgroundRequestSchema } from './playground-request-schema';
import { playgroundFeatureSchema } from './playground-feature-schema';
import { featureVariantsSchema } from './feature-variants-schema';
export const playgroundResponseSchema = {
$id: '#/components/schemas/playgroundResponseSchema',
@ -16,15 +17,30 @@ export const playgroundResponseSchema = {
features: {
type: 'array',
items: {
$ref: playgroundFeatureSchema.$id,
allOf: [
{ $ref: playgroundFeatureSchema.$id },
{
type: 'object',
required: ['variants'],
properties: {
variants: {
type: 'array',
items: {
$ref: featureVariantsSchema.$id,
},
},
},
},
],
},
},
},
components: {
schemas: {
sdkContextSchema,
playgroundRequestSchema,
featureVariantsSchema,
playgroundFeatureSchema,
playgroundRequestSchema,
sdkContextSchema,
},
},
} as const;

View File

@ -1877,7 +1877,25 @@ Object {
"properties": Object {
"features": Object {
"items": Object {
"$ref": "#/components/schemas/playgroundFeatureSchema",
"allOf": Array [
Object {
"$ref": "#/components/schemas/playgroundFeatureSchema",
},
Object {
"properties": Object {
"variants": Object {
"items": Object {
"$ref": "#/components/schemas/featureVariantsSchema",
},
"type": "array",
},
},
"required": Array [
"variants",
],
"type": "object",
},
],
},
"type": "array",
},