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 return_type parameter examples in ruby-client #1399

Merged
merged 2 commits into from
Nov 12, 2018

Conversation

meganemura
Copy link
Contributor

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 and ./bin/security/{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

Fix the wrong examples of return_type.
We need <> brackets for parsing return_type.
See:

when /\AArray<(.+)>\z/
# e.g. Array<Pet>
sub_type = $1
data.map { |item| convert_to_type(item, sub_type) }
when /\AHash\<String, (.+)\>\z/
# e.g. Hash<String, Integer>
sub_type = $1
{}.tap do |hash|
data.each { |k, v| hash[k] = convert_to_type(v, sub_type) }
end

@wing328
Copy link
Member

wing328 commented Nov 8, 2018

@meganemura thanks for the PR. Can you please run ./bin/ruby-petstore.sh or bin\windows\ruby-petstore.bat to update the Petstore samples so that CI can verify the change?

@meganemura
Copy link
Contributor Author

@wing328

./bin/ruby-petstore.sh produces many diffs 😩

In bin/utils/ensure-up-to-date, we runs bin/openapi3/ruby-client-petstore.sh to check whether the sample is up-to-date or not.
So I use bin/openapi3/ruby-client-petstore.sh to build sample client and commit it.

By the way, do we need ./bin/ruby-petstore.sh? If not, I will remove it.

@meganemura
Copy link
Contributor Author

meganemura commented Nov 10, 2018

I think we need to update some java samples since the build of master branch is broken.

https://circleci.com/gh/OpenAPITools/openapi-generator/3274#tests/containers/2

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/JSON.java
	modified:   samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/JSON.java
	modified:   samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/JSON.java
	modified:   samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/JSON.java
	modified:   samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/JSON.java
	modified:   samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/JSON.java

no changes added to commit (use "git add" and/or "git commit -a")
Please run 'bin/utils/ensure-up-to-date' locally and commit changes (UNCOMMITTED CHANGES ERROR)
Exited with code 1

@wing328
Copy link
Member

wing328 commented Nov 12, 2018

@meganemura right. I've fixed the issue in master via #1405. Thanks again for your contribution 👍

@wing328 wing328 merged commit 9db62f4 into OpenAPITools:master Nov 12, 2018
@meganemura meganemura deleted the ruby-fix-sample branch November 12, 2018 07:47
@wing328
Copy link
Member

wing328 commented Nov 15, 2018

@meganemura thanks again for the PR, which has been included in the v3.3.3 release: https://twitter.com/oas_generator/status/1062929948191510528

A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
* Fix return_type parameter examples

* $ bin/openapi3/ruby-client-petstore.sh
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

2 participants