Schwager API

Al empate Schwager.

rodber
rodber   GitHub

New from Chevere is the Schwager package. This software generates an API spec, which is a document that describes how to interact with an API created using Router.

Schwager takes many influences from OpenAPI and if you don't get the joke in the name: Schwager means "brother in law" and it sounds a lot like Swagger (former OpenAPI's name).

# 16th competing standard

This xkcd never gets old when it comes to talk about standards.

It took me about a week to rip-off OpenAPI design and improve it to my please. My focus was to provide a system enabling to easy expose the API, supporting PSR-15 and with considerable less maintenance needs.

As I designed Router, Http and Schwager, all components works flawlessly each other with minimal user effort needed.

My standard exists because it was way cheaper for me to spawn this project than be bound to OpenAPI's from now.

# API specification

The Schwager API specification is unsurprisingly familiar to OpenAPI on:

  • The servers and paths members
  • Responses mapped by status code
  • Parameter schemas

But Schwager differs on several key elements. At first, it is white-label as you can define api property freely enabling you to set the pace for each project by defining its own API standard.

Schwager doesn't merge parameters like OpenAPI. Path variables are mapped at path level while body and query parameters have its own respective namespace.

Finally, Schwager enables to define more than one response schema per status code.

# Learn more

Head over to the documentation and check the source at GitHub.

Rodolfo blogging since 2012.