[dart][dart-dio] Improved library specific template usage - #10742
Conversation
|
what do the samples look like for these ? Edit: nvm, didn't notice the changes in |
|
this is actually very cool, we can take it a step further to generalize all serialization operations in the api
one other issue to think about is inline enums, since they are scoped per request, each serialization library has its own handling of it |
|
Yeah the samples are up to date :) I can move this forward and add it in all places if there is a general consensus. Then we can base the json_serializable option on this. |
|
@wing328 what do you think about this approach? I would like to reuse the existing |
|
It's a good approach, it would be valuable to see it working on bigger and more complex generators |
|
Not sure it is applicable on many generators, I think this approach works well here because we don't have a switch for the http library (dio) so all the other serialization library specific parts are very small and scoped. |
e2f0057 to
c72087d
Compare
|
@wing328 I think this can be merged |
|
Everything else can be adapted to this approach when there is a 2nd serialization library |
|
@kuhnroyal sorry that I missed your message earlier. Can you please resolve the merge conflicts when you've time? |
c72087d to
da597a8
Compare
|
@wing328 rebased |
da597a8 to
1dc3929
Compare
Improved library specific template usage.
This is just an idea on how to make templating for different libraries a little bit easier.
With this the main templates don't have to be changed when adding a new library.
It could be used for the new json_serializable library option that is happening in some branch.
Any thoughts?
CC @jaumard (2018/09) @josh-burton (2019/12) @amondnet (2019/12) @sbu-WBT (2020/12) @kuhnroyal (2020/12) @agilob (2020/12) @ahmednfwela (2021/08)
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.For Windows users, please run the script in Git BASH.
master(5.3.0),6.0.x