1.0.0-rc.0
TypeSpec 1.0 Release Candidate
Section titled âTypeSpec 1.0 Release CandidateâWeâre excited to announce the TypeSpec 1.0 Release Candidate, marking a significant milestone for the TypeSpec project. TypeSpec accelerates your initial API development while providing a sustainable approach to evolving your APIs over time. Design faster today by defining your APIs in a concise, human-readable format and generating all the artifacts you need from a single source of truth â OpenAPI specifications, client libraries, and server code scaffolding. Scale easier tomorrow with an API-first approach that keeps everything in sync as your API grows and requirements change.
@typespec/compiler@typespec/http@typespec/openapi@typespec/openapi3@typespec/json-schema
All the other typespec libraries remain in preview, beta or alpha stage.
Breaking Changes
Section titled âBreaking Changesâ@typespec/compiler
Section titled â@typespec/compilerâ-
#6678 Moved
TypeSpecPrettierPlugintype to internal. If wanting to use the prettier pluging programmatically, use it from the@typespec/prettier-plugin-typespecpackage -
#6544 Remove deprecated
@typespec/compiler/emitter-frameworkexport in favor of a new package@typespec/asset-emitterpackage.json "dependencies": {"@typespec/asset-emitter": "^1.0.0-rc.0"}import { TypeEmitter, ... } from "@typespec/compiler/emitter-framework";import { TypeEmitter, ... } from "@typespec/asset-emitter"; -
#6754 Reserve additional keywords:
contextsymproppropertyscenario
@typespec/http
Section titled â@typespec/httpâ-
#6557 Remove support for deprecated implicit multipart, migrate to explicit part with
@multipartBodyandHttpPart<T>op upload(@header contentType: "multipart/form-data",@body body: {@multipartBody body: {name: string;name: HttpPart<string>;avatar: bytes;avatar: HttpPart<bytes>;}): void; -
#6563 Separate file bodies into their own
bodyKind.The HTTP library will now return a body with
bodyKind: "file"in all cases where emitters should treat the body as a file upload or download. Emitters that previously attempted to recognize File bodies by checking thetypeof an HTTP"single"body may now simply check if thebodyKindis"file". This applies to all HTTP payloads where anHttpOperationBodycan appear, including requests, responses, and multipart parts.
@typespec/openapi3
Section titled â@typespec/openapi3â-
#6557 Remove support for removed feature implicit multipart.
-
#6563 Separate file bodies into their own
bodyKind.The HTTP library will now return a body with
bodyKind: "file"in all cases where emitters should treat the body as a file upload or download. Emitters that previously attempted to recognize File bodies by checking thetypeof an HTTP"single"body may now simply check if thebodyKindis"file". This applies to all HTTP payloads where anHttpOperationBodycan appear, including requests, responses, and multipart parts.
Features
Section titled âFeaturesâ@typespec/http
Section titled â@typespec/httpâ- #6559 [API] Expose
property?onHttpOperationPart - #6652 Add validation when using path or query options with the default value while the parameter is referenced in the uri template
@typespec/prettier-plugin-typespec
Section titled â@typespec/prettier-plugin-typespecâ- #6678 Migrate to ESM. This shouldnât be breaking as we didnât support prettier < 3.
Bug Fixes
Section titled âBug Fixesâ@typespec/compiler
Section titled â@typespec/compilerâ- #6197 Show emitter internal error message in tspconfig
- #6710 Updates to scaffolding script and scaffold commands for consistency
- #6826 Fix new reserved keywords were not allowed in augment decorator expression
- #6697 Fix crash that would happen when a type was mutated while using null in a decorator(e.g. when using versioning library with
@example(null)) - #6711 Fix extra properties not validated in nested entries of the config
- #6711 Fix passing nested emitter options with
--option
@typespec/http
Section titled â@typespec/httpâ-
#6542 Query parameter with
-will be correctly represented in the resulting uri template -
#6472 Path parameters can now be optional under specific circumstances. This fix updates the validation to ensure it doesnât trigger in these scenarios.
An optional parameter should have a leading
/inside the{}.For example:
@route("optional{/param}/list")op optional(@path param?: string): void;Another supported scenario is using
@autoRoute:@autoRouteop optional(@path param?: string): void;
@typespec/openapi
Section titled â@typespec/openapiâ- #6651 Adds diagnostic when passing in a
Typeto the$extensiondecorator function directly
@typespec/openapi3
Section titled â@typespec/openapi3â- #6559 Fix missing application of description on multipart properties
- #6729 Fix duplicate name error when using named union inside multipart part.
- #6506 Fix union of custom scalar with
nullcreating anobjectwithallOfreference
typespec-vscode
Section titled âtypespec-vscodeâ- #6668 Fix error when upgrading to use latest telemetry library
- #6690 Fix the issue to log compiler information as an error. And remove PREVIEW prefix for server code emitter
- #6694 compiler can be resolved automatically when itâs not installed in the root folder of the first opened workspace.
- #6620 Update menu item and command text for âShow OpenAPI3 Documentationâ and âImport TypeSpec from OpenApi3â