Skip to content

Commit

Permalink
docs: improve open api (#3535)
Browse files Browse the repository at this point in the history
## About the changes
Amends based on #3519
  • Loading branch information
gastonfournier committed Apr 18, 2023
1 parent 7debbeb commit 5940a81
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
7 changes: 4 additions & 3 deletions src/lib/openapi/spec/feature-tag-schema.ts
Expand Up @@ -15,7 +15,8 @@ export const featureTagSchema = {
tagType: {
type: 'string',
example: 'simple',
description: 'The type of tag',
description:
'The [type](https://docs.getunleash.io/reference/tags#tag-types tag types) of the tag',
},
tagValue: {
type: 'string',
Expand All @@ -26,13 +27,13 @@ export const featureTagSchema = {
deprecated: true,
type: 'string',
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: {
deprecated: true,
type: 'string',
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: {},
Expand Down
6 changes: 4 additions & 2 deletions src/lib/openapi/spec/tag-schema.ts
Expand Up @@ -5,7 +5,8 @@ export const TAG_MAX_LENGTH = 50;
export const tagSchema = {
$id: '#/components/schemas/tagSchema',
type: 'object',
description: 'Representation of a tag',
description:
'Representation of a [tag](https://docs.getunleash.io/reference/tags)',
additionalProperties: false,
required: ['value', 'type'],
properties: {
Expand All @@ -21,7 +22,8 @@ export const tagSchema = {
minLength: TAG_MIN_LENGTH,
maxLength: TAG_MAX_LENGTH,
default: 'simple',
description: 'The type of the tag',
description:
'The [type](https://docs.getunleash.io/reference/tags#tag-types) of the tag',
example: 'simple',
},
},
Expand Down
3 changes: 2 additions & 1 deletion src/lib/openapi/spec/update-tags-schema.ts
Expand Up @@ -4,7 +4,8 @@ import { tagSchema } from './tag-schema';
export const updateTagsSchema = {
$id: '#/components/schemas/updateTagsSchema',
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,
required: ['addedTags', 'removedTags'],
properties: {
Expand Down
12 changes: 6 additions & 6 deletions src/test/e2e/api/openapi/__snapshots__/openapi.e2e.test.ts.snap
Expand Up @@ -1688,7 +1688,7 @@ exports[`should serve the OpenAPI spec 1`] = `
"type": "string",
},
"tagType": {
"description": "The type of tag",
"description": "The [type](https://docs.getunleash.io/reference/tags#tag-types tag types) of the tag",
"example": "simple",
"type": "string",
},
Expand All @@ -1699,12 +1699,12 @@ exports[`should serve the OpenAPI spec 1`] = `
},
"type": {
"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",
},
"value": {
"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",
},
},
Expand Down Expand Up @@ -3785,11 +3785,11 @@ Stats are divided into current and previous **windows**.
},
"tagSchema": {
"additionalProperties": false,
"description": "Representation of a tag",
"description": "Representation of a [tag](https://docs.getunleash.io/reference/tags)",
"properties": {
"type": {
"default": "simple",
"description": "The type of the tag",
"description": "The [type](https://docs.getunleash.io/reference/tags#tag-types) of the tag",
"example": "simple",
"maxLength": 50,
"minLength": 2,
Expand Down Expand Up @@ -4135,7 +4135,7 @@ Stats are divided into current and previous **windows**.
},
"updateTagsSchema": {
"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": {
"addedTags": [
{
Expand Down

0 comments on commit 5940a81

Please sign in to comment.