Skip to main content
Version: Latest (Core: 0.57.x, Azure: 0.43.x)

Decorators

Autorest​

@example​

@example - attaches example files to an operation. Multiple examples can be specified.

@example can be specified on Operations.

@Autorest.example(pathOrUri: valueof string, title: valueof string)

Target​

Operation

Parameters​

NameTypeDescription
pathOrUrivalueof stringpath or Uri to the example file.
titlevalueof stringname or description of the example file.

@useRef​

@useRef - is used to replace the TypeSpec model type in emitter output with a pre-existing named OpenAPI schema such as Azure Resource Manager common types.

@useRef can be specified on Models and ModelProperty.

@Autorest.useRef(jsonRef: valueof string)

Target​

Model | ModelProperty

Parameters​

NameTypeDescription
jsonRefvalueof stringpath or Uri to an OpenAPI schema.