microsoft / microsoft/typespec
Support @readOnly/@writeOnly in JSON Schema and OpenAPI?
Open
design:needed
docs
triaged:core
- Dominant language
- Java
- Stars
- 5.9k
- Forks
- 394
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 104
Description
In the [decorators](https://typespec.io/docs/language-basics/decorators) documentation, there is a mention of a `@readOnly `decorator. But I'm unable to find it in the playground.
Maybe it's outdated?
```typescript
model Dog {
name: string;
}
@@readOnly(Dog.name);
```
Related to that, I would like to understand what's the current state about supporting readOnly/writeOnly in OpenAPI 3.0 and JsonSchema 2020-12 (that both support it). From this [issue ](https://github.com/microsoft/typespec/issues/453) it seems some work has been done, but I couldn't find a way to produce a "readOnly" property in OpenAPI
Contributor guide
Assessment
This issue has not been assessed yet.