Skip to main content

Example 1. The simplest API

JSight API 0.3OpenAPI 3.0.1 (Swagger)
JSIGHT 0.3

GET /cats/{id}
200
{
"id" : 123, // {min: 1}
"name": "Tom"
}

Pay attention to the main feature of the JSight API language. The basis for a data schema is an example of valid data. Additional data requirements are specified in C-like comments. This approach greatly simplifies the data schema and makes it intuitively clear. Practice shows that such schema is very simple to create, read and edit.

Learn more about the JSight language: Quick Tutorial.

Star us on GitHub — it motivates us a lot!

openapi: 3.0.1
info:
title: ""
version: ""
paths:
/cats/{id}:
get:
parameters:
- name: id
in: path
required: true
schema: {}
responses:
200:
description: ""
content:
application/json:
schema:
type: object
required: [id, name]
properties:
id:
type: integer
minimum: 1
example: 123
name:
type: string
example: "Tom"