microsoft / microsoft/typespec

Support @readOnly/@writeOnly in JSON Schema and OpenAPI?

Open
#2,944 6 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.