We currently define @tagMetadata in openapi library to map to openapi meaning. However it could be beneficial to define tags as a more core typespec feature. Current @tag is a core decorator that just take a string. We could expand to allow enum member which would allow defining available tags as enum(s)
import "@typespec/openapi";
@tags
enum Tags {
/** Abc tag */
@summary("Abc")
@OpenAPI.externalDocs("")
// parent
// kind
tagA,
/** Abc tag */
@tagParent(Tags.tagA)
@tagKind("abc")
tagB,
}
@tag(Tags.tagA)
op a(): void;
Playground Link
Category as separate enums
enum TagGroupA {
a,
b,
}
enum TagGroupB {
a,
b,
}
We currently define
@tagMetadatain openapi library to map to openapi meaning. However it could be beneficial to define tags as a more core typespec feature. Current@tagis a core decorator that just take a string. We could expand to allow enum member which would allow defining available tags as enum(s)Playground Link
Category as separate enums