- Update the YAML configuration in SwaggerHub. Saving it will commit it to GitHub (SWAGGERHUB branch) if a GitHub integration has been created.
- Pull the SWAGGERHUB changes
- Branch locally into devel
- Cherry-pick the SWAGGERHUB commit corresponding to the code generation
- In another terminal window, cd into the openapi-generator folder and run the following to generate the code
$ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \
-i $HOME/git/willitsync/yaml-resolved/swagger.yaml \
--generator-name python-flask \
-o $HOME/git/willitsync/python-flask
- In the local willitsync terminal window, run
git status
to see what has changed. Revert any files that you did not wish to change. - Test
>>> import requests
>>> url = 'http://localhost:8080/jevans97utk/willitsync/1.0.1/robots'
>>> params = {'url': 'https://latimes.com/robots.txt'}
>>> r = requests.get(url, params=params)
>>> r.json()
[{'evaluated_date': '2019-11-01T08:36:02',
'log': None,
'sitemaps': ['https://www.latimes.com/sitemap.xml',
'https://www.latimes.com/news-sitemap.xml'],
'url': 'https://latimes.com/robots.txt'}]
- Commit the changes on the devel branch (possibly squash the cherry-picked commit?)
- When development work is done, the version number could be updated, but this necessitates creating a new GitHub integration. Most of the details of creating the new integration is straightforward, but be sure to set the items below correctly. Consult the documentation at https://app.swaggerhub.com/help/integrations/github-sync for details.
- Sync Method: Basic Sync
- Branch: SWAGGERHUB
- Generated API Code: YAML (Resolved)