Skip to content

Commit 2886c1d

Browse files
committed
chore: test listof description format
1 parent 06d32e8 commit 2886c1d

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

packages/core/src/types/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,15 @@ export type NormalizedNodeType = {
4848
type NormalizedPropType = NormalizedNodeType | NormalizedScalarSchema | null | undefined;
4949
type NormalizedResolveTypeFn = (value: any, key: string) => NormalizedPropType;
5050

51-
export function listOf(typeName: string) {
51+
export function listOf(
52+
typeName: string,
53+
opts: { description?: string; documentationLink?: string } = {}
54+
) {
5255
return {
5356
name: `${typeName}List`,
5457
properties: {},
5558
items: typeName,
59+
...opts,
5660
};
5761
}
5862

packages/core/src/types/oas3.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,20 @@ const Root: NodeType = {
2323

2424
const Tag: NodeType = {
2525
properties: {
26-
name: { type: 'string' },
26+
name: {
27+
type: 'string',
28+
description: `The name of the tag.`,
29+
documentationLink: `https://spec.openapis.org/oas/v3.1.0#tag-object-name`,
30+
},
2731
description: { type: 'string' },
2832
externalDocs: 'ExternalDocs',
2933
'x-traitTag': { type: 'boolean' },
3034
'x-displayName': { type: 'string' },
3135
},
3236
required: ['name'],
3337
extensionsPrefix: 'x-',
38+
description: `The Tag Object represents a tag used by the OAS. It is not mandatory to have a tag object per tag used by the OAS but each tag object can contain additional metadata.`,
39+
documentationLink: `https://spec.openapis.org/oas/v3.1.0#tag-object`,
3440
};
3541

3642
const TagGroup: NodeType = {
@@ -540,7 +546,9 @@ const XUsePkce: NodeType = {
540546
export const Oas3Types = {
541547
Root,
542548
Tag,
543-
TagList: listOf('Tag'),
549+
TagList: listOf('Tag', {
550+
description: `A list of tags used by the document with additional metadata.`,
551+
}),
544552
TagGroups: listOf('TagGroup'),
545553
TagGroup,
546554
ExternalDocs,

0 commit comments

Comments
 (0)