Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add Missing Mapping of DateTime in Multipart #679

Merged

Conversation

Sadhorsephile
Copy link
Contributor

@Sadhorsephile Sadhorsephile commented Jun 5, 2024

Problem

If we have a request like this:

  @MultiPart()
  @POST('/api/some/path/')
  Future<SomeResponse> requestName({
    @Part(name: 'full_name') required String fullName,
    @Part(name: 'birth_date') required DateTime birthDate,

we'll get a toJson() method have to add to DateTime Exception.

Solution

If part param doesn't have the toJson() method, we have to check whether this is DateTime. If so, we use atoIso8601String method.

@trevorwang trevorwang merged commit c47415a into trevorwang:master Jul 1, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants