Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAPI Tools

A static website to perform various OpenAPI operations (tested with OpenAPI 3.0.x).

  • Validation of a YAML OpenAPI definition
  • Validating a JSON call against a YAML OpenAPI definition
  • Convert the YAML OpenAPI definition to a dereferenced JSON schema (additionally with each RequestBody as a single JSON schema).

Available here through GitHub Pages:

Problem

Having created my OpenAPI definition in YAML, I have no way to test/validate sample calls against it until I roll it out on an API management solution.

For JSON schemas, there are many validators on the internet. However, there is little to convert the OpenAPI definition to a JSON schema. Even if I succeed in converting, I need JSON schemas per RequestBody to be able to validate meaningfully.

There are numerous useful OpenAPI tools to solve the problems described. You can find a list here. However, the tools are either paid SaaS solutions, but mostly server-side/cli-based libraries.

Solution

  • A simple website where I can insert my OpenAPI definition (without having to host it publicly).
  • At the push of a button, I can validate an inserted sample json call against my OpenAPI definition.
  • Errors are displayed directly and understandably.
  • With the click of a button, I can dereference my OpenAPI definition, export it to a JSON schema and create JSON schemas for each request body. The result is downloaded directly as a ZIP file.
  • All described functions run in my browser without my OpenAPI definition or my JSON request leaving my browser.
  • Using existing libraries to do the heavy lifting.

In part, this project will be obsolet with the spread of OpenAPI 3.1.x, since this version is fully compatible with the JSON Schema definition.

Static site approach

Not everyone wants to process their API definitions and sample requests on foreign servers. Therefore, the project is designed as a static website: All data remains with you and your browser.

To achieve this, browserify is used in the package.json to build the npm modules for client-side use. Admittedly - the implementation in the package.json is a bit shaky - but it works.

Plus, I don't have to pay a hoster - thanks GitHub Pages!

Dependencies

This project is highly reliant on the packages used, which do most of the work 🙂

About

A static website to perform various OpenAPI operations.

Topics

Resources

Stars

Watchers

Forks

Used by

Contributors

Languages