microsoft / microsoft/typespec

Should typespec error if a model used for merge patch includes a nullable property

Open
#2,875 3 comments 0 reactions 0 assignees View on GitHub
triaged:core
Dominant language
Java
Stars
5.9k
Forks
394
Avg merge
1d 23h
Merged PRs (30d)
104

Description

In the below scenario since the model is used for merge patch it should include null in the possible range of values for any of its properties.

```
model Foo {
name?: string
description?: string | null
}

op Update(@header content-type: "application/merge-patch+json", ...Foo) : void
```

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.