1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-09 00:18:00 +01:00

docs: improve open api (#3535)

## About the changes
Amends based on https://github.com/Unleash/unleash/pull/3519
This commit is contained in:
Gastón Fournier 2023-04-18 08:50:36 +02:00 committed by GitHub
parent 7debbeb00d
commit 5940a81158
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 12 deletions

View File

@ -15,7 +15,8 @@ export const featureTagSchema = {
tagType: { tagType: {
type: 'string', type: 'string',
example: 'simple', example: 'simple',
description: 'The type of tag', description:
'The [type](https://docs.getunleash.io/reference/tags#tag-types tag types) of the tag',
}, },
tagValue: { tagValue: {
type: 'string', type: 'string',
@ -26,13 +27,13 @@ export const featureTagSchema = {
deprecated: true, deprecated: true,
type: 'string', type: 'string',
description: description:
'This field is deprecated and currently unused, use tagType instead', 'The [type](https://docs.getunleash.io/reference/tags#tag-types tag types) of the tag. This property is deprecated and will be removed in a future version of Unleash. Superseded by the `tagType` property.',
}, },
value: { value: {
deprecated: true, deprecated: true,
type: 'string', type: 'string',
description: description:
'This field is deprecated and currently unused, use tagValue instead', 'The value of the tag. This property is deprecated and will be removed in a future version of Unleash. Superseded by the `tagValue` property.',
}, },
}, },
components: {}, components: {},

View File

@ -5,7 +5,8 @@ export const TAG_MAX_LENGTH = 50;
export const tagSchema = { export const tagSchema = {
$id: '#/components/schemas/tagSchema', $id: '#/components/schemas/tagSchema',
type: 'object', type: 'object',
description: 'Representation of a tag', description:
'Representation of a [tag](https://docs.getunleash.io/reference/tags)',
additionalProperties: false, additionalProperties: false,
required: ['value', 'type'], required: ['value', 'type'],
properties: { properties: {
@ -21,7 +22,8 @@ export const tagSchema = {
minLength: TAG_MIN_LENGTH, minLength: TAG_MIN_LENGTH,
maxLength: TAG_MAX_LENGTH, maxLength: TAG_MAX_LENGTH,
default: 'simple', default: 'simple',
description: 'The type of the tag', description:
'The [type](https://docs.getunleash.io/reference/tags#tag-types) of the tag',
example: 'simple', example: 'simple',
}, },
}, },

View File

@ -4,7 +4,8 @@ import { tagSchema } from './tag-schema';
export const updateTagsSchema = { export const updateTagsSchema = {
$id: '#/components/schemas/updateTagsSchema', $id: '#/components/schemas/updateTagsSchema',
type: 'object', type: 'object',
description: 'Represents a set of changes to tags of a feature.', description:
"Represents a set of changes to a feature's tags, such as adding or removing tags.",
additionalProperties: false, additionalProperties: false,
required: ['addedTags', 'removedTags'], required: ['addedTags', 'removedTags'],
properties: { properties: {

View File

@ -1688,7 +1688,7 @@ exports[`should serve the OpenAPI spec 1`] = `
"type": "string", "type": "string",
}, },
"tagType": { "tagType": {
"description": "The type of tag", "description": "The [type](https://docs.getunleash.io/reference/tags#tag-types tag types) of the tag",
"example": "simple", "example": "simple",
"type": "string", "type": "string",
}, },
@ -1699,12 +1699,12 @@ exports[`should serve the OpenAPI spec 1`] = `
}, },
"type": { "type": {
"deprecated": true, "deprecated": true,
"description": "This field is deprecated and currently unused, use tagType instead", "description": "The [type](https://docs.getunleash.io/reference/tags#tag-types tag types) of the tag. This property is deprecated and will be removed in a future version of Unleash. Superseded by the \`tagType\` property.",
"type": "string", "type": "string",
}, },
"value": { "value": {
"deprecated": true, "deprecated": true,
"description": "This field is deprecated and currently unused, use tagValue instead", "description": "The value of the tag. This property is deprecated and will be removed in a future version of Unleash. Superseded by the \`tagValue\` property.",
"type": "string", "type": "string",
}, },
}, },
@ -3785,11 +3785,11 @@ Stats are divided into current and previous **windows**.
}, },
"tagSchema": { "tagSchema": {
"additionalProperties": false, "additionalProperties": false,
"description": "Representation of a tag", "description": "Representation of a [tag](https://docs.getunleash.io/reference/tags)",
"properties": { "properties": {
"type": { "type": {
"default": "simple", "default": "simple",
"description": "The type of the tag", "description": "The [type](https://docs.getunleash.io/reference/tags#tag-types) of the tag",
"example": "simple", "example": "simple",
"maxLength": 50, "maxLength": 50,
"minLength": 2, "minLength": 2,
@ -4135,7 +4135,7 @@ Stats are divided into current and previous **windows**.
}, },
"updateTagsSchema": { "updateTagsSchema": {
"additionalProperties": false, "additionalProperties": false,
"description": "Represents a set of changes to tags of a feature.", "description": "Represents a set of changes to a feature's tags, such as adding or removing tags.",
"example": { "example": {
"addedTags": [ "addedTags": [
{ {