cbleek / JobArchive

job archive
MIT License
0 stars 0 forks source link

Howto update the API #4

Closed cbleek closed 5 years ago

cbleek commented 5 years ago

@SJhumili

I'm thinking about the best way to collaborate. Swagger has nice team features, but they cost money and make the project dependent on swagger.io.

I wonder how I'm going to make a change to the API.

Your last commit changed 2 files. How did you do that?

So far I thought you only had to change one file in the Github repo. I had imagined that I would cut&paste the last version of the API into my sagger editor, make changes, and then cut&paste the new version into my checked out GIT Repo to push the change.

Can you please describe how we should make changes to the API?

tpikachu commented 5 years ago

Ok, please provide your swagger account and then I'll update api in your swagger api project. So I mean I'll sign in with your swagger account and paste new api to your swagger editor. How about that?

cbleek commented 5 years ago

No. We have to manage it without sharing Accounts. I've imported the API and added the integration "Github Sync"

auswahl_689

Now I see a SWAGGERHUB in the github Repo.

cbleek commented 5 years ago

I think, i got it.

I,ve configured the API option "git push".

auswahl_690

I've set the "path to openapi file" to "openapi.yaml". Saving the file in the swagger edititor results into a git push.

But a lot of line are marked as modified. The indents and quotes are different in my swagger commit than in yours.

https://github.com/cbleek/JobArchive/pull/5/commits/e6c68b0e153a765c88e82f0d553f1cafc93dd79c

cbleek commented 5 years ago

I've reached to get a clean diff https://github.com/cbleek/JobArchive/pull/6/commits/5882d2a44d464d7495cee14e2f99db0ae65112a5

I've done it by:

  1. creating a swagget-test2

  2. deactivating the API Option "git push"

auswahl_691

  1. Updating the YAML with the latest Version vom Master branch and clicking "save" in the swagger editor

The Commit Message I've modified on Github in the PR.

So this would we a possible way for somebody, you cannot push to the master.

You can push to the master an write commit messages. How do you do that? Or are you not using the Git Feature of swagger at all? Do you cut&paste the YAML into your favorit IDE an push?

tpikachu commented 5 years ago

Yeah, I know that way to push swagger code to the github repo/SWAGGERHUB. But with this way we can push code to only our own repo. So I mean, I can push swagger code to only my repo and I can't push it to your repo. But with your Github account I can push this to your repo. But you said you can't share your account either swagger 's or github's.

So, Until now, I just made swagger code in swagger editor and copy the code and paste in my project and then I used to push it to your JobArchive/master. Should I push it another branch not master?

cbleek commented 5 years ago

Push your code into the master. The way you do it is the easiest way.

I'll summarize briefly: To work on the API you have to:

  1. git clone git@github.com:cbleek/JobArchive.git
  2. import latest openapi.yaml into swagger editor
  3. make modifications in swagger editor
  4. copy&paste the yaml back checked out repo
  5. git commit -m "my commit message" & git push