Skip to content

Commit b70f55a

Browse files
authored
feat(openapi-spec-builder): add withTags function to spec-builder (#826)
1 parent 1b71f05 commit b70f55a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/openapi-spec-builder/src/openapi-spec-builder.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,16 @@ export class OperationSpecBuilder extends BuilderBase<OperationObject> {
162162
withOperationName(name: string): this {
163163
return this.withExtension('x-operation-name', name);
164164
}
165+
166+
/**
167+
* Describe tags associated with the operation
168+
* @param tags
169+
*/
170+
withTags(tags: string | string[]): this {
171+
if (typeof tags === 'string') this._spec.tags = [tags];
172+
else {
173+
this._spec.tags = tags;
174+
}
175+
return this;
176+
}
165177
}

0 commit comments

Comments
 (0)