When generating a REST client from Swagger/OpenAPI, JsonPatchDocument often isn’t correctly serialized because code generators don’t handle its internal structure properly. It should serialize as a list of patch operations, but instead, it may serialize as an empty object or malformed data
Fix: Use a custom model, e.g. List<PatchOperation> to represent the patch operations manually, ensuring correct serialization on the wire.