You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When sending any user-defined models as multipart/form-data, Xcode could not build generated codes because of missing a method called encodeToJSON that is a member of JSONEncodable protocol.
Although existing primitive types conforms to this protocol, user-defined model does not.
Implement encodeToJSON method for any user-defined models by protocol extension.
extensionJSONEncodablewhere Self:Encodable{func encodeToJSON()->Any{letencoder=JSONEncoder()
guard let data =try? encoder.encode(self)else{fatalError("Could not encode to json: \(self)")}return data.base64EncodedString(options:Data.Base64EncodingOptions())}}
Then, to confirm JSONEncodable for user-defined model, edit modelObject.mustache.
I already implement these codes and tested using 101da6e
If this request is acceptable, I will send PR.
The text was updated successfully, but these errors were encountered:
Currently no.
The 5.4.0 has a known issue that will be fixed in the next version.
So maybe you want to keep using 5.3.X while the next version is not released.
Otherwise you could create a jar by building this project from source.
Is your feature request related to a problem? Please describe.
When sending any user-defined models as
multipart/form-data
, Xcode could not build generated codes because of missing a method calledencodeToJSON
that is a member ofJSONEncodable
protocol.Although existing primitive types conforms to this protocol, user-defined model does not.
For example, Xcode could not build this API.
Describe the solution you'd like
Implement
encodeToJSON
method for any user-defined models by protocol extension.Then, to confirm
JSONEncodable
for user-defined model, editmodelObject.mustache
.I already implement these codes and tested using 101da6e
If this request is acceptable, I will send PR.
The text was updated successfully, but these errors were encountered: