Skip to content

Swagger for RESTFull based API and micro services

Amnon Heiman edited this page Apr 8, 2015 · 3 revisions

Introduction

Swagger is a DSL that describe REST API. It is the JSON equivalent of an XSD to XML, and similar to XML, swagger file is a json file.

There are multiple client implementation in different languages that accepts swagger definition and create a client from it.

Seastar httpd implementation was design as a potential micro-service or an internal API. For example, errors returned from the server are a legal JSON object.

A code generation that is part of the build attempts to make sure that the API definition and implementation are the same at compile time.

Code Generation

The code generation scripts create an hh file for each json file that contains: API definitions, enums and classes.

API (Path)

enum

classes