
Security News
Inside Lodash’s Security Reset and Maintenance Reboot
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.
@typespec/rest
Advanced tools
TypeSpec REST protocol binding
npm install @typespec/rest
@action@actionSeparator@autoRoute@collectionAction@copyResourceKeyParameters@createsOrReplacesResource@createsOrUpdatesResource@createsResource@deletesResource@listsResource@parentResource@readsResource@resource@segment@segmentOf@updatesResource@actionSpecify this operation is an action. (Scoped to a resource item /pets/{petId}/my-action)
@TypeSpec.Rest.action(name?: valueof string)
Operation
| Name | Type | Description |
|---|---|---|
| name | valueof string | Name of the action. If not specified, the name of the operation will be used. |
@actionSeparatorDefines the separator string that is inserted before the action name in auto-generated routes for actions.
@TypeSpec.Rest.actionSeparator(seperator: valueof "/" | ":" | "/:")
Model | ModelProperty | Operation
| Name | Type | Description |
|---|---|---|
| seperator | valueof "/" | ":" | "/:" | Seperator seperating the action segment from the rest of the url |
@autoRouteThis interface or operation should resolve its route automatically. To be used with resource types where the route segments area defined on the models.
@TypeSpec.Rest.autoRoute
Interface | Operation
None
@autoRoute
interface Pets {
get(@segment("pets") @path id: string): void; //-> route: /pets/{id}
}
@collectionActionSpecify this operation is a collection action. (Scopped to a resource, /pets/my-action)
@TypeSpec.Rest.collectionAction(resourceType: Model, name?: valueof string)
Operation
| Name | Type | Description |
|---|---|---|
| resourceType | Model | Resource marked with |
| name | valueof string | Name of the action. If not specified, the name of the operation will be used. |
@copyResourceKeyParametersCopy the resource key parameters on the model
@TypeSpec.Rest.copyResourceKeyParameters(filter?: valueof string)
Model
| Name | Type | Description |
|---|---|---|
| filter | valueof string | Filter to exclude certain properties. |
@createsOrReplacesResourceSpecify that this is a CreateOrReplace operation for a given resource.
@TypeSpec.Rest.createsOrReplacesResource(resourceType: Model)
Operation
| Name | Type | Description |
|---|---|---|
| resourceType | Model | Resource marked with |
@createsOrUpdatesResourceSpecify that this is a CreatesOrUpdate operation for a given resource.
@TypeSpec.Rest.createsOrUpdatesResource(resourceType: Model)
Operation
| Name | Type | Description |
|---|---|---|
| resourceType | Model | Resource marked with |
@createsResourceSpecify that this is a Create operation for a given resource.
@TypeSpec.Rest.createsResource(resourceType: Model)
Operation
| Name | Type | Description |
|---|---|---|
| resourceType | Model | Resource marked with |
@deletesResourceSpecify that this is a Delete operation for a given resource.
@TypeSpec.Rest.deletesResource(resourceType: Model)
Operation
| Name | Type | Description |
|---|---|---|
| resourceType | Model | Resource marked with |
@listsResourceSpecify that this is a List operation for a given resource.
@TypeSpec.Rest.listsResource(resourceType: Model)
Operation
| Name | Type | Description |
|---|---|---|
| resourceType | Model | Resource marked with |
@parentResourceMark model as a child of the given parent resource.
@TypeSpec.Rest.parentResource(parent: Model)
Model
| Name | Type | Description |
|---|---|---|
| parent | Model | Parent model. |
@readsResourceSpecify that this is a Read operation for a given resource.
@TypeSpec.Rest.readsResource(resourceType: Model)
Operation
| Name | Type | Description |
|---|---|---|
| resourceType | Model | Resource marked with |
@resourceMark this model as a resource type with a name.
@TypeSpec.Rest.resource(collectionName: valueof string)
Model
| Name | Type | Description |
|---|---|---|
| collectionName | valueof string | type's collection name |
@segmentDefines the preceding path segment for a
@TypeSpec.Rest.segment(name: valueof string)
Model | ModelProperty | Operation
| Name | Type | Description |
|---|---|---|
| name | valueof string | Segment that will be inserted into the operation route before the path parameter's name field. |
@segmentOfReturns the URL segment of a given model if it has @segment and @key decorator.
@TypeSpec.Rest.segmentOf(type: Model)
Operation
| Name | Type | Description |
|---|---|---|
| type | Model | Target model |
@updatesResourceSpecify that this is a Update operation for a given resource.
@TypeSpec.Rest.updatesResource(resourceType: Model)
Operation
| Name | Type | Description |
|---|---|---|
| resourceType | Model | Resource marked with |
FAQs
TypeSpec REST protocol binding
The npm package @typespec/rest receives a total of 106,403 weekly downloads. As such, @typespec/rest popularity was classified as popular.
We found that @typespec/rest demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.

Security News
n8n led JavaScript Rising Stars 2025 by a wide margin, with workflow platforms seeing the largest growth across categories.

Security News
The U.S. government is rolling back software supply chain mandates, shifting from mandatory SBOMs and attestations to a risk-based approach.