Versioning
The emitter integrates with @typespec/versioning:
import "@typespec/versioning";using TypeSpec.Versioning;
@versioned(Versions)namespace MyAPI;
enum Versions { v1: "1.0.0"; v2: "2.0.0";}Precedence
Section titled “Precedence”info.version resolves in this order:
- The emitter
versionoption @apiVersiondecorator- The latest
@versionedenum value "1.0.0"(fallback)
Versioned libraries
Section titled “Versioned libraries”When your spec imports a @versioned library, the latest enum value of the importing namespace wins — so a spec that consumes MyLib@v2 emits info.version: 2.0.0 unless overridden.
Where to go next
Section titled “Where to go next”- Emitter Options — the
versionoption - Security — scheme declarations
- Quick Start — the basics