Decorators
TypeSpec.OpenAPI
@defaultResponse
Specify that this model is to be treated as the OpenAPI default
response.
This differs from the compiler built-in @error
decorator as this does not necessarily represent an error.
Target
Model
Parameters
None
Examples
@extension
Attach some custom data to the OpenAPI element generated from this type.
Target
unknown
Parameters
Name | Type | Description |
---|---|---|
key | valueof string | Extension key. Must start with x- |
value | unknown | Extension value. |
Examples
@externalDocs
Specify the OpenAPI externalDocs
property for this type.
Target
unknown
Parameters
Name | Type | Description |
---|---|---|
url | valueof string | Url to the docs |
description | valueof string | Description of the docs |
Examples
@info
Specify OpenAPI additional information.
The service title
and version
are already specified using @service
.
Target
Namespace
Parameters
Name | Type | Description |
---|---|---|
additionalInfo | AdditionalInfo | Additional information |
@operationId
Specify the OpenAPI operationId
property for this operation.
Target
Operation
Parameters
Name | Type | Description |
---|---|---|
operationId | valueof string | Operation id value. |
Examples
@tagMetadata
Specify OpenAPI additional information.
Target
Namespace
Parameters
Name | Type | Description |
---|---|---|
name | valueof string | tag name |
tagMetadata | valueof TagMetadata | Additional information |