microsoft/typespec

Public

mirrored from https://github.com/microsoft/typespecAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
e966efd30e552f4e84d5ae7224515199738ddd8e

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

packages/openapi/README.md

34lines · modepreview

# Cadl OpenAPI Library

This package provide [Cadl](https://github.com/microsoft/cadl) decorators to specify some OpenAPI specific concepts.

## Install

In your cadl project root

```bash
npm install @cadl-lang/openapi
```

## Use OpenAPI specific decorators:

```cadl
import "@cadl-lang/openapi";

using OpenAPI;

// Using `using`
@extension("x-custom", "MyCustomValue")
model Foo {}

// Using fully qualified names
@OpenAPI.operationId("custom_Foo")
op foo(): string;

```

## See also

- [Cadl Getting Started](https://github.com/microsoft/cadl#getting-started)
- [Cadl Tutorial](https://github.com/microsoft/cadl/blob/main/docs/tutorial.md)
- [Cadl for the OpenAPI Developer](https://github.com/microsoft/cadl/blob/main/docs/cadl-for-openapi-dev.md)