Azure / Azure/azure-sdk-for-java

[MGMT] discussion, PATCH in ARM resource

Open
#45,829 0 comments 0 reactions 1 assignee Claimed by @weidongxu-microsoft View on GitHub
Mgmt
Dominant language
Java
Stars
2.6k
Forks
2.2k
Avg merge
2d 9h
Merged PRs (30d)
199

Description

PATCH on ARM is `application/json`.

However, for ARM RPC:
```
The behavior for patching of the fields inside the properties envelope should follow JSON merge-patch ([RFC 7396](https://tools.ietf.org/html/rfc7396)).
```

The highlight is the `properties` envelope.
```
{
"properties": {
// here
},
"sku": ...,
"tags": ...,
"identities": ...,
}
```

We've seen some service follows this, and setting a property under `properties` to `null` in PATCH means unset the value.

Therefore, I think it safe to say, if user sets a property to `null`, and send the class as ARM PATCH, we'd like the serialization to output `"property": null` on it.

Currently I do not have good idea on how to do this in mgmt. As our previous effort for JSON Merge Patch is based on DPG style in v1, while in v2 we do not use the DPG style.

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.