[Bash] Bash client script generator#4541
Merged
wing328 merged 6 commits intoswagger-api:masterfrom Jan 12, 2017
Merged
Conversation
Contributor
|
@bkryza this PR is of very high quality 🍻 . Thanks for your contribution 👍 One suggestion I have is to check the Bash version at the start. Here is what I got when running with Bash 3.x: It's showing the error message about incorrect Bash version at the end. What I would suggest is to perform a check at the start so as to avoid showing too many syntax error messages (as some users might simply skip all the error messages when the result is showing too many errors...) |
Contributor
Contributor
Author
Contributor
|
@bkryza thanks! It's not really an issue, just a minor enhancement to make it better 😄 |
davidgri
pushed a commit
to davidgri/swagger-codegen
that referenced
this pull request
May 11, 2017
* Initial commit * Remormatted petstore tests * Added Bash codegen to main README.md * Added bash to integration tests * Fixed stdin detection in generated script * Added back ruby module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR checklist
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shand./bin/security/{LANG}-petstore.shif updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates)2.3.0branch for breaking (non-backward compatible) changes.Description of the PR
@wing328
This is a PR with a new template for generating standalone single-file Bash script clients whose only dependencies are Bash >4.3 and cURL.
The generated script contains a comprehensive help for listing all operations of the service as well as detailed help for each operation.
In addition, the codegen generates Bash and Zsh completion scripts which greatly simplifies usage of the script for larger API's.
Underneath, the script uses cURL to generate actual REST calls.
The main advantage of this generator is the possibility to create a command line tool which can be used to instantly test a web service without writing a single line of code, or to provide your web service users with a simple tool which they can download from a URL without the need to install any dependencies and development frameworks.
Main features
--dry-runoptionUsage
If you'd like to check the generator in practice you can to this in these few steps after cloning the PR:
More information is available in the README.md in codegen resources here.
Tests
I added basic unit tests for the Java part of the generator as well as integration tests for the petstore service.
For the integration tests I needed 2 dependencies to the main .travis.yml
Please let me know what you think about this codegen and how can I improve it to integrate it into master.