swagger-codegen icon indicating copy to clipboard operation
swagger-codegen copied to clipboard

Fixed ssv and tsv formats. Added csv.

Open borisbn opened this issue 7 years ago • 5 comments

Fixed query array parameters for collection formats ssv and tsv. Added csv format

PR checklist

  • [x] 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\.
  • [x] Filed the PR against the correct branch: 3.0.0 branch for changes related to OpenAPI spec 3.0. 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)

borisbn avatar Apr 05 '18 07:04 borisbn

cc the technical committee: @ravinikam @stkrwork @fvarose @etherealjoy @martindelille

wing328 avatar Apr 05 '18 08:04 wing328

@borisbn Can you run bin/qt5-petstore.sh and push the example updated code so we can discuss the generated code?

MartinDelille avatar Apr 09 '18 09:04 MartinDelille

@MartinDelille Sorry, but I'm very new to GitHub (it's my first commit at all), and I don't know how to push files to repository in my branch(( Maybe I should create a new commit? I'll attach generated code to this comment. Sorry once more. samples.zip

borisbn avatar Apr 10 '18 06:04 borisbn

@borisbn yes, after updating the files, you will need to add a new commit (git commit -a) and push out the new commit to your batch "patch-1" (git push origin patch-1) so this PR will contain 2 commits (or more)

(if there are new files, you will need to include the new files with "git add -A")

wing328 avatar Apr 10 '18 06:04 wing328

@borisbn @wing328 Small edit:

You may not be able to push to origin since you don't have write access to https://github.com/swagger-api/swagger-codegen

Let me tell you how I manage to make pull request:

First I clone the original code:

git clone https://github.com/swagger-api/swagger-codegen

Then I switch branch:

git checkout -b fix-something

I perform my edit and commit it to this new branch.

I fork the github repo (clicking the fork button here: https://github.com/swagger-api/swagger-codegen).

I need to add a new remote to my local repository:

git remote add md https://github.com/martindelille/swagger-codegen

Note that md is the remote name (and my initial by the way). You can use whatever you need.

To check that your remote are well set-up, you can type:

$ git remote -v
md	https://github.com/martindelille/swagger-codegen (fetch)
md	https://github.com/martindelille/swagger-codegen (push)
origin	https://github.com/swagger-api/swagger-codegen/ (fetch)
origin	https://github.com/swagger-api/swagger-codegen/ (push)

Now I push my commit to my Github repository:

git push -u md fix-something

Note that -u allow to tight this local branch with the remote branch. Next time I'll want to push a commit I could only do git push.

Now if you go back to https://github.com/swagger-api/swagger-codegen, I can see a button proposing to create a pull request.

In your case, you already have fork the repository (since we can see it here: https://github.com/borisbn/swagger-codegen) so you just need to do the following:

Add the remote to your local repository:

git remote add borisbn https://github.com/borisbn/swagger-codegen

Pull your branch:

git pull borisbn --all

Checkout your branch:

git checkout patch-1

Do your edit:

bin/qt5-petstore.sh

Commit it:

git commit -a

Push it:

git push

After that your change should appear in this PR.

I hope I'm clear! Don't hesitate to ask if necessary!

MartinDelille avatar Apr 10 '18 08:04 MartinDelille