Closed Bikram-Shrestha closed 2 months ago
Is your feature request related to a problem? Please describe. Currently there seems to be no way to make a patch request that take JsonPatch with content type application/json-patch+json
application/json-patch+json
Describe the solution you'd like Implement RFC6902 Patch
import 'package:rfc_6901/rfc_6901.dart'; import 'package:rfc_6902/rfc_6902.dart' class DevicePatchDTO{ ....... JsonPatch toJsonPatch() => JsonPatch.build([Replace(JsonPointer('/isPushEnabled'), isPushEnabled)]); }
...........
class DeviceService{ ...... Future<void> makeRf6902Patch( DevicePatchDTO devicePatchDTO, ) async { await _dio.patchUri( Uri.https('example.org','/device'), options: Options(contentType: 'application/json-patch+json'), data: deviceRegistrationPatchDTO.toJsonPatch(), ); } }
I am not sure how to replicate this in retrofit and have found no documentation or way to implement this with retrofit.
Managed to solve this by passing list of obj that has toJson() method that return Json obj instead of toJson method in JsonPatch which return List
Is your feature request related to a problem? Please describe. Currently there seems to be no way to make a patch request that take JsonPatch with content type
application/json-patch+json
Describe the solution you'd like Implement RFC6902 Patch
...........
I am not sure how to replicate this in retrofit and have found no documentation or way to implement this with retrofit.