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 #4157 dart enum toJson method #6111

Merged
merged 1 commit into from
May 15, 2020
Merged

Conversation

b1rdG
Copy link
Contributor

@b1rdG b1rdG commented Apr 29, 2020

Just create a toJson method for enum serialization. As you can see on: #4157 (comment) :

On the version 4.3.1 the serialize function delegate on dart convert library json.encode(). It return an error because serializing this enums because the enum is not "encodable" (is not a number, boolean, string, null, list or a map), so the encode() method looks for a toJson() on the Object passed:

  /// If [toEncodable] is omitted, it defaults to a function that returns the
  /// result of calling `.toJson()` on the unencodable object.

So I implemented this method on the template.

@wing328
Copy link
Member

wing328 commented May 1, 2020

Thanks for the PR but your commit (as shown in the Commits tab) is not linked to your Github account, which means this PR won't count as your contribution in https://github.com/OpenAPITools/openapi-generator/graphs/contributors.

Let me know if you need help fixing it.

Ref: https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-can-i-update-commits-that-are-not-linked-to-my-github-account

@wing328
Copy link
Member

wing328 commented May 8, 2020

cc @ircecho (2017/07) @swipesight (2018/09) @jaumard (2018/09) @nickmeinhold (2019/09) @athornz (2019/12) @amondnet (2019/12)

@wing328 wing328 added this to the 5.0.0 milestone May 15, 2020
@wing328 wing328 merged commit 942035a into OpenAPITools:master May 15, 2020
jimschubert added a commit that referenced this pull request May 16, 2020
* master:
  Update username (arun-nalla) (#6319)
  [typescript-axios] Implement useSingleRequestParameter option (#6288)
  [typescript] Remove "v4-compat" value of enumSuffix (#6308)
  Mark swift4 generator as deprecated (#6311)
  Remove @nickmeinhold from Dart technical committee (#6309)
  Migrate Erlang samples to use OAS 3 spec (#6297)
  update dart samples
  Improve parameter documentation (#6092)
  Minor improvements to `plantuml` doc generator (#6298)
  undo changes to petstore.yaml oas3.0 (#6299)
  Allow passing progress callbacks through client methods. (#6261)
  Create method to json (#6111)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants