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

Generate a ruby-client sample for OpenAPI 2.0 #1482

Merged
merged 3 commits into from
Nov 19, 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

Move output directory for bin/openapi3/ruby-client-petstore.sh
to sample/client/petstore/ruby
from sample/openapi3/client/petstore/ruby-client.

And generate ruby-client for OpenAPI 2.0 by bin/ruby-client-petstore.sh
to sample/client/petstore/ruby.

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

@meganemura
Copy link
Contributor Author

I found that the generated ruby-client for OpenAPI 2.0 has a syntax-error.

> Regexp.new(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$)
Traceback (most recent call last):
        1: from /Users/meganemura/.rbenv/versions/2.5.3/bin/irb:11:in `<main>'
SyntaxError ((irb):1: premature end of char-class: /^(?:[A-Za-z0-9+/)
(irb):1: syntax error, unexpected ']', expecting ')'
Regexp.new(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A...

https://github.com/OpenAPITools/openapi-generator/pull/1482/files#diff-cb91f29a2d3eab894268b3e54a7df278R198
https://github.com/OpenAPITools/openapi-generator/pull/1482/files#diff-cb91f29a2d3eab894268b3e54a7df278R237
https://github.com/OpenAPITools/openapi-generator/pull/1482/files#diff-cb91f29a2d3eab894268b3e54a7df278R336

See also #1393

@meganemura
Copy link
Contributor Author

@wing328 Would you please review this?

@wing328
Copy link
Member

wing328 commented Nov 18, 2018

@meganemura thanks for the fix. I'll review shortly.

For the following:

Move output directory for bin/openapi3/ruby-client-petstore.sh
to sample/client/petstore/ruby
from sample/openapi3/client/petstore/ruby-client.

I prefer putting Petstore client samples for OpenAPI v3 spec under sample/openapi3/client/petstore/ to make it consistent with other OpenAPI v3 samples.

@wing328 wing328 added this to the 3.3.4 milestone Nov 18, 2018
@meganemura
Copy link
Contributor Author

@wing328
oops. I wrote a wrong description.
Its from/to was opposite.

This change moves ruby-client v3 from sample/client/petstore to sample/openapi3/client/petstore.

@wing328 wing328 merged commit b9949e1 into OpenAPITools:master Nov 19, 2018
@wing328
Copy link
Member

wing328 commented Nov 19, 2018

@meganemura PR merged into master. Thanks for the PR.

cc @cliffano (2017/07) @zlx (2017/09)

@meganemura meganemura deleted the ruby-samples branch November 19, 2018 09:03
A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
* Move output directory for bin/openapi3/ruby-client-petstore.sh

$ git mv sample/client/petstore/ruby sample/openapi3/client/petstore/ruby-client

* $ bin/ruby-client-petstore.sh

* Run bin/ruby-client-petstore.sh in bin/utils/ensure-up-to-date
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