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

Perl: Better Support for hash in deserialization #2713

Merged

Conversation

yue9944882
Copy link
Member

@yue9944882 yue9944882 commented Apr 22, 2019

For now, resolving types like HASH[string,string] or ARRAY[string] will fail with:

deserializing $VAR1 = '105215470';
with string
deserializing $VAR1 = {
'foo.com/foo-populated' => 'true',
};
with HASH[string,string]
Can't call method "from_hash" on an undefined value at /Users/zuoxiu.jm/git/perl/lib/Kubernetes/Object/V1ObjectMeta.pm line 136.

This pull fixes the behavior

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master, 3.4.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

(details of the change, additional tests that have been done, reference to the issue for tracking, etc)

@wing328
Copy link
Member

wing328 commented Apr 22, 2019

@yue9944882 thanks for the PR.

Can you please run ./bin/perl-petstore.sh or the corresponding batch file under bin\windows\perl-petstore.bat to update the Perl petstore client so that CIs can verify the test?

@yue9944882
Copy link
Member Author

@wing328 thank you for helping. (the pull gets far bigger than i imagine)

@wing328 wing328 added this to the 4.0.0 milestone Apr 23, 2019
@yue9944882 yue9944882 force-pushed the bugfix/fix-nested-primitive-hash-array branch 3 times, most recently from 6c1050a to 13062b1 Compare April 23, 2019 07:18
@yue9944882 yue9944882 force-pushed the bugfix/fix-nested-primitive-hash-array branch from 13062b1 to 8cb268e Compare April 23, 2019 07:23
@wing328
Copy link
Member

wing328 commented Apr 23, 2019

The CircleCI issue can be ignored as it has been fixed in the master.

Copy link
Member

@wing328 wing328 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and the result is good.

@wing328 wing328 merged commit 06fdc92 into OpenAPITools:master Apr 23, 2019
@wing328 wing328 changed the title Bugfix(Perl): Support nested primitive types in ARRARY or HASH for basic object Perl: Better Support for HASH in deserialization Apr 23, 2019
@wing328 wing328 changed the title Perl: Better Support for HASH in deserialization Perl: Better Support for hash in deserialization Apr 23, 2019
jimschubert added a commit that referenced this pull request Apr 25, 2019
* master: (40 commits)
  Remove quotation marks around {{paramName}} for header params in api-body.mustache (#2727)
  Add FiNC Technologies (#2728)
  fix missing parenthesis for http bearer auth (#2723)
  Add missing closing parenthesis (#2720)
  update perl test with correct body parameter (#2717)
  [Java][Spring] Fix template for reactive implementation with `interfaceOnly` parameter (#2437)
  Bugfix(Perl): Support nested primitive types in ARRARY or HASH for basic object (#2713)
  Remove `-XX:MaxPermSize` (#2712)
  Remove setting generateAliasAsModel in rust server generator (#2714)
  update rust server samples
  Revert "update rust samples"
  update rust samples
  update samples
  [Rust Server] Improve XML support (#2504)
  Improve CONTRIBUTING.md (#2699)
  [PHP][Lumen] Rename template folder (#2707)
  [aspnetcore] Support async tasks and some code cleanups (#2629)
  [C++][Pistache] Fixed #2643 (#2653)
  update petstore samples (#2697)
  [JAVA][Webclient]fix select body for url encoded media type. (#2686)
  ...
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.

2 participants