ogen-go / ogen

OpenAPI v3 code generator for go
https://ogen.dev
Apache License 2.0
1.46k stars 86 forks source link

Allow content-type `application/merge-patch+json` #1348

Open uga-rosa opened 6 days ago

uga-rosa commented 6 days ago

Description

First, thank you for a great generation tool!

In a patch request, there is a meaningful difference between setting a field to null and a field being missing, but handling this in Go can be challenging. I was looking for projects that are seriously addressing this issue.

https://ogen.dev/docs/types/optional/

However, despite such excellent efforts, I realized that it is not possible to use the content-type application/merge-patch+json.

The internal processing should be almost the same as JSON, so the necessary implementation can be kept to a minimum. I would appreciate your support.

References