Skip to content

Travis CI script for your Swagger/OpenAPI Specification

Hossain Khan
2 min read
TL;DR AI Summary

Recently I have been working with swagger in a project. Swagger 2.0 has become an open standard and now referred to as OpenAPI Specification (OAS).

I also love medium.com, so when I saw their API doc was hand written in plain text, I thought it would be a good exercise to convert it to OpenAPI Specification format. The result is https://github.com/hossain-khan/medium-api-specification

Now, recently I’ve started adding Travis Continuous Integration (CI) script for most of my recent projects. So, I wanted to add CI support for this OAS project.

UPDATE: I have written another article that leverages GitHub actions and node modules to validate different things. Use this article to validate anything including Swagger/OpenAPI specifications.

Use node.js tools on GitHub actions CI workflow - On April 14th, 2020 GitHub announced a major change in their plans to allow free private repositories. It’s a good time…

Adding Travis CI build support for OpenAPI specification

Googling for this specific topic didn’t bring much content. I wanted to keep the script simple and use existing validator provided by swagger-validator-badge web service (NOTE: There are dozens of validators in different languages built by the community - see http://swagger.io/open-source-integrations/).

Here are the key elements used for CI:

I hope somebody finds this useful for their project.

Previous
Impact on Android dex limit when using Kotlin
Next
Helpful Android apps for Developers