Version Bump only.
- #9223 Upgrade dependencies
- #9311 Fix empty response models with
statusCodedefined in a base model
- #8962 support documentation on union variants for response descriptions
- #9046 Upgrade dependencies
- #8961 Support nested unions in operation return types
- #8823 Upgrade dependencies
- #8974 Do not report
no-service-foundif there is a service even if it has no routes - #8737 Fix
@bodyIgnoreproperty shouldn't count as implicit body property for check
No changes, version bump only.
- #8317 Upgrade dependencies
- #8276 fix: circular import causing tsp compile --watch breakage
- #7771 Fix OAuth2 scope deduplication in OpenAPI spec generation. OAuth2 authentication schemes with multiple flows sharing the same scopes no longer generate duplicate scope entries in the security section.
- #7978 Upgrade dependencies
- #7674 Upgrade dependencies
- #7849 Fix optional path parameter with explicit name would have the wrong style(
pathinstead ofsimple).
No changes, version bump only.
- #7259 Fix diagnostic for
PatchOptions.implicitOptionality, which refers a non-existing property and the incorrect value. To keep the old behavior, you will need to use@patch(#{ implicitOptionality: true })instead.
-
#7230 Changed
@patchso that it does not apply the "implicit optionality" transform by default anymore.@patch op update(@body pet: Pet): void;
To use JSON Merge-Patch to update resources, replace the body property with an instance of
MergePatchUpdateas follows:@patch op update(@body pet: MergePatchUpdate<Pet>): void;
Or, keep the old behavior by explicitly enabling
implicitOptionalityin the@patchoptions:@patch(#{ implicitOptionality: true }) op update(@body pet: Pet): void;
- #7207 Implemented JSON Merge-Patch wrappers. This allows converting a type to a JSON Merge-Patch compatible update record using the
MergePatchUpdateandMergePatchCreateOrUpdatetemplates.
- #7168 Replace optional param validation requiring use with path expansion and replace with a warning when the resulting url might have a double
/
- #7049 Updates
$.httpOperation.getto be a diagnosable - use$.httpOperation.get.withDiagnosticsto get diagnostics - #6949 Improved types for HTTP multipart payloads for more precise guarantees and additional information about the resolution of individual parts.
- #6962 Fixes issue where each variant of a
@discriminatedunion was treated as a separate response instead of the whole union being treated as a single response. - #7069 Handle types without node
- #7065 Handle tuples without nodes
-
#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.
- #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
- #6595 Upgrade dependencies
-
#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:@autoRoute op optional(@path param?: string): void;
-
#6387 Removing deprecated items
-
isContentTypeHeader -
setLegacyStatusCodeState
Moved to internal
-
setStatusCode -
#6305 Remove deprecated items:
-
formatoption from@headerand@querydecorators. Useexplodeoption instead.-@header(#{ format: "multi"}) -@query(#{ format: "multi"}) +@header(#{ explode: true }) +@query(#{ explode: true })
-
sharedoption from@routedecorator. Please use@sharedRouteinstead.-@route("/doStuff", { shared: true }) +@sharedRoute +@route("/doStuff")
-
Javascript functions and typescript types:
HeaderOptions.formatHeaderFieldOptions.formatQueryOptions.formatQueryParameterOptions.formatMetadataInfo.isEmptiedincludeInterfaceRoutesInNamespacegetAllRoutes->getAllHttpServicesOperationDetails->HttpOperationServiceAuthentication->AuthenticationHttpOperationParameters.bodyType->body.typeHttpOperationParameters.bodyParameter->body.parameterStatusCode->HttpStatusCodesEntry
-
#6433 Stop exposing APIs that were not meant for external users. Please file issue if you had legitmate use of some of those APIs.
@includeInapplicableMetadataInPayloaddecorator was moved toPrivatenamespace and stop exposing the accessor.- Functions used in
getHttpOperationto resolve the finalized view of the http operation but shouldn't be used directly.resolvePathAndParameters
validateRouteUniqueinternal api used in http library validation- Moved custom route producer related APIs to experimental with
unsafe_prefix. Those APIs are not ready for public use and will change in future.DefaultRouteProducer->unsafe_DefaultRouteProducergetRouteProducer->unsafe_getRouteProducersetRouteProducer->unsafe_setRouteProducersetRouteOptionsForNamespace->unsafe_setRouteOptionsForNamespaceRouteProducer->unsafe_RouteProducerRouteProducerResult->unsafe_RouteProducerResultRouteResolutionOptions->unsafe_RouteResolutionOptionsRouteOptions->unsafe_RouteOptions
-
#5977 Minimum node version is now 20
-
#6357 Changed the default content-type resolution behavior as follows:
-
As before, if the content-type header is explicitly specified (
@header contentType: valueof string), the explicit content type is used (this behavior has not changed). -
If the type of an HTTP payload body has a Media Type hint (
@mediaTypeHint), that media type is preferred as the default content-type for the request. -
The default content-type for
TypeSpec.byteshas been changed toapplication/octet-streamto avoid serializing the data to base64-encoded JSON. -
The default content-type for all other scalar types has been changed to
text/plain(previously, it wasapplication/json). -
For multipart payloads, the default content-type of the payload has been changed to
multipart/form-dataif the@multipartBodyparameter has a Model type andmultipart/mixedif the multipart payload has a tuple type.- The content-type of individual parts in the multipart request has been changed to be the same as for HTTP payload bodies and follows the logic described above.
-
#6464 Deprecate implicit multipart body
op upload( @header contentType: "multipart/form-data", - @body body: { + @multipartBody body: { - name: string; + name: HttpPart<string>; - avatar: bytes; + avatar: HttpPart<bytes>; } ): void;
- #6345 Update
BasicAuthandBearerAuthtypes scheme to use standard name for schemeBasic,Bearer - #6327 Remove reference to delete projection feature
- #6266 Update dependencies
- #6513 HTTP Media type resolution logic now treats literal types (String, Boolean, Numeric, and StringTemplate types) as equivalent to their given scalar types for the purposes of resolving their Media Type.
- #6130 Updates
@headerdecorator to accept values and adds theexplodeoption. Note that using the model expression syntax to pass in arguments, or using theformatfield, are now deprecated.
op example1(
- @header({ name: "ETag" }) etag: string
+ @header(#{ name: "ETag" }) etag: string
): void;
op example2(
- @header({ format: "csv" }) list: string[]
+ @header list: string[]
): void;- #5996 Emitter Framework V2
- #5690 Upgrade dependencies
- #5340 Add Experimental Typekit helpers for
@typespec/http
- #5153 Adds getStreamMetadata JS API to simplify getting stream metadata from operation parameters and responses.
- #5016 Uri template attributes were not extracted when parameter was explicitly mark with
@pathor@queryas well
- #4932 [API] Fix: Generated
uriTemplatecorrectly include*for explode query params - #4804 The description parameter of
@serveris now optional.
- #4679 Upgrade dependencies - October 2024
- #4424 Bump dependencies
- #4513 Adds HttpStream and JsonlStream models to to support streaming use-cases.
- #4322 Use user provided description of model if model has a status code property(detect it as an response envelope)
- #4139 Internals: Migrate to new api for declaring decorator implementation
- #4155 HotFix: Uri template not correctly built when using
@autoRoute
- #3909 Fix
HttpPartnot respecting explicit part name by always using the property name - #3933 Fix some diagnostic not showing the right message
- #3948 Update dependencies
-
#4046 API: Expose
properties: HttpProperty[]on operation parameter and response which reference all the properties of interest(Body, statusCode, contentType, implicitBodyProperty, etc.) -
#3932
@routecan now take a uri template as defined by RFC-6570@route("files{+path}") download(path: string): void;
-
#3932 API deprecation:
HttpOperation#pathSegmentsis deprecated. UseHttpOperation#uriTemplateinstead. -
#3932 Deprecated
@query({format: })option. Use@query(#{explode: true})instead offormormultiformat. Previouslycsv/simpleis the default now. Decorator is also expecting an object value now instead of a model. A deprecation warning with a codefix will help migrating.- @query({format: "form"}) select: string[]; + @query(#{explode: true}) select: string[];
- #3718 Dependency updates July 2024
- #3717 Allow overriding base operation verb
- #3676 Expose
getHttpPartand types functions - #3732 Expose
modelproperty onHttpAuthto retrieve original type used to define security scheme
-
#3737 Keep trailing slash when building http routes, this is breaking if you used to have
@route()ending with/.TypeSpec Before After @route("users/")usersusers/@route("users")usersuserson interface @route("users/")and on op@route("addresses/")users/addressesusers/addresses/on interface @route("users/")and on op@route("addresses")users/addressesusers/addresses
- #3022 Update Flow Template to make use of the new array values
- #3401 Update dependencies - May 2024
-
#3342 Add new multipart handling. Using
@multipartBodywithHttpPart<Type, Options>. See multipart docs for more information.op upload(@header contentType: "multipart/mixed", @multipartBody body: { name: HttpPart<string>; avatar: HttpPart<bytes>[]; }): void;
-
#3462 Use new compiler automatic
allruleset instead of explicitly provided one
- #3196 Fix password flow defining
authorizationUrlinstead oftokenUrl - #3190 Fix
@pathparam mapping when spreading a record in operation parameters - #3218 Fix:
@pathproperty shouldn't be applicableMetadata if the visibility containsRead
- #3169 Update dependencies
-
#2945 Empty model after removing metadata and applying visibility always results in "void" This means the following case have changed from returning
{}to no bodyop b1(): {}; op b2(): {@visibility("none") prop: string}; op b3(): {@added(Versions.v2) prop: string};
Workaround: Use explicit
@bodyop b1(): {@body _: {}}; op b2(): {@body _: {@visibility("none") prop: string}}; op b3(): {@body _: {@added(Versions.v2) prop: string}};
-
#2945 Implicit status code always 200 except if response is explicitly
voidop c1(): {@header foo: string}; // status code 200 (used to be 204)
Solution: Add explicit
@statusCodeop c1(): {@header foo: string, @statusCode _: 204}; op c1(): {@header foo: string, ...NoContent}; // or spread common model
-
#2945
@bodymeans this is the bodyThis change makes using
@bodymean this is the exact body and everything underneath will be included, including metadata properties. If metadata properties are present on the body, a warning will be logged.op a1(): {@body _: {@header foo: string, other: string} }; ^ warning header in a body, it will not be included as a header.
Use
@bodyRootif you want to only change where to resolve the body from.op a1(): {@bodyRoot _: {@header foo: string, other: string} };
-
#2945 Properties are not automatically omitted if everything was removed from metadata or visibility
op d1(): {headers: {@header foo: string}}; // body will be {headers: {}}
Solution: use
@bodyIgnoreop d1(): {@bodyIgnore headers: {@header foo: string}}; // body will be {headers: {}}
- #3027 Update dependencies
- #2948 Fix don't emit shared route error when verb don't match
- #2900 Update dependencies
- #2901 Add ability to sepcify authentication and different scopes per operation
- #2958 Validate that only one
@useAuthdecorator is applied to a type.
- 8ed1d82: Fix: OpenIDConnect types not exposed on the TypeScript types
Wed, 24 Jan 2024 05:46:53 GMT
- Fix:
@pathcustom name not respected - Fix: Wrong route generated when path parameter is not alpha numeric(Either with a different name provided in
@pathor if the property name is not an identifier) - Migrate to new Internal/Public library definition
- Rename template parameters in preparation for named template argument instantiation.
- Update dependencies
Wed, 06 Dec 2023 19:40:58 GMT
- Add diagnostic when a namespace exists with routes, but no namespace is marked with
@service.
Wed, 08 Nov 2023 00:07:17 GMT
TypeScriptusetypesentry underexportsofpackage.jsoninstead of legacytypesVersionsto provide the definition files- BREAKING CHANGE Dropped support for node 16, minimum node version is now 18
Wed, 11 Oct 2023 23:31:35 GMT
- Add support for
@returnsand@errorsdoc comment tags. - Add support for status code ranges for http responses. Change to API Http responses can now also return a
HttpStatusCodeRangeobject for their status codes - Emit error when multiple properties on a response model have the
@statusCodedecorator. - Update dependencies
Tue, 12 Sep 2023 21:47:11 GMT
- Deprecated
getRequestVisibility. Added methodsgetDefaultVisibilityForVerbandresolveRequestVisibility. Use either depending on the situation. - Add validation step to check whether any operation references another operation with a route prefix defined on a parent container. This helps avoid unexpected route changes when using operation references.
- Avoid runtime errors when
OAuth2Authis given invalidOAuth2Flowarguments
Tue, 08 Aug 2023 22:32:10 GMT
- Update doc for openapi developers
- Add collection format support: simple, form, ssv, tsv, pipes
Tue, 11 Jul 2023 22:06:00 GMT
- Add documentation on
@headerauto header name resolution from property name. - Support nested
@body - Update dependencies
Tue, 06 Jun 2023 22:44:16 GMT
- Uptake doc comment changes
- Update decorators to use
valueof - Update decorators signature to use
{}instead ofobject - Add signature for missing decorators
Wed, 10 May 2023 21:24:00 GMT
- Cleanup deprecated use
- No longer issues an error for multiple different responses for the same status code.
- Add
@sharedRoutedecorator for marking operations as sharing a route with other operations - Deprecate the
sharedoption in the@routedecorator.@sharedRouteis the new way to accomplish the same behavior. - Update dependencies
Fri, 14 Apr 2023 15:09:01 GMT
- Fix query format not accepting anything other than
csvandmulti
Tue, 11 Apr 2023 18:49:17 GMT
- Breaking change
@headerand@queryno longer default theformattocsvandmultirespectively. A value must now be provided when the type is an array.
Mon, 13 Mar 2023 21:30:44 GMT
- Make canonical visibility configurable and default to none.
Fri, 03 Mar 2023 19:59:17 GMT
- Move core HTTP functionality from
@typespec/restinto a new@typespec/httplibrary