A Golang-based tool to convert OpenAPI spec into .docx
based format.
Licensed under MIT License
- Convert OpenAPI spec into .docx format
- Support OpenAPI 3.0 version
- Feature to automatically push the result into Google Drive*1
*1 need to have Google Cloud Platform account with additional steps required. Tutorial below.
- Go >= v1.14
- Make sure you have fulfilled the requirements above
- Git clone
https://github.com/weisurya/go-openapi-converter
- Go build
go build -i -o go-openapi-converter app/main.go
- Type
go-openapi-converter -h
to learn more about the available commands - Type
convert -s sample.v1.yaml -t template/standard.docx -o result.sample.docx
to convert OpenAPI spec into .docx format - Type
upload -c credentials.sample.json -d directory -e foo@gmail.com -f result.sample.docx
to upload file into Google Drive - To learn more about each command, please type
-h
- Use Google Cloud Platform. If you don't have any account, please create it first.
- Go to console > create new project
- On menu, choose
APIs & Services
> chooseLibrary
- Search
Google Drive API
> clickEnable
- If this is your first time, you need to create OAuth Consent Screen. Go to
APIs & Services
> chooseOAuth consent screen
- Create new app > set user type as
External
, set the scope forGoogle APIs
based on your needs > clickSave
- Back to
APIs & Services
> chooseCredentials
> click+ Create Credentials
> chooseService account
- Fill up the
Service account detail
based on your preference > set permission based on your preference (i.e. Project Owner) > Create key in JSON format > store the result
- Only support for
application/json
based schema - Not support nested
$ref
- The order of endpoint between table of content and list of endpoint hasn't same yet
- Numbering list does not appear on Google Docs
- Fork this repository
- Clone this repository into your local machine (
git clone https://github.com/weisurya/go-openapi-converter
) - Go to the project directory (
cd go-openapi-converter
) - Create a new branch (
git checkout -b your-new-feature
) - Try to run the code (
go run app/main.go
) - Make changes and add commit them
- Push your branch into the fork-ed repository (
git push origin your-new-feature
) - Create new pull request (
https://github.com/weisurya/go-openapi-converter/pulls
)