Skip to content

Instantly share code, notes, and snippets.

@su8ru
Last active May 3, 2020 22:04
Show Gist options
  • Save su8ru/e0cbb5e47db8c7e4074b290c35d204be to your computer and use it in GitHub Desktop.
Save su8ru/e0cbb5e47db8c7e4074b290c35d204be to your computer and use it in GitHub Desktop.
KO・S Train Location Back-end API Documentation
openapi: 3.0.0
info:
version: 1.0.0
title: KO・S Train Location Back-end
contact:
name: su8ru
email: contact@su8ru.dev
servers:
- url: https://kostl.su8ru.app
- url: http://localhost:8000 # for local test
paths:
/vehicles:
post:
summary: post vehicle info
tags:
- vehicle
requestBody:
description: vehicle info
content:
application/json:
schema:
type: object
required:
- unyo
- vehicle
properties:
unyo:
type: string
vehicle:
type: string
responses:
201:
description: post successful
content:
application/json:
schema:
type: object
400:
description: some params are invalid
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
get:
summary: get all unyo vehicles info
tags:
- vehicle
responses:
200:
description: all unyo vehicles info
content:
application/json:
schema:
type: object
additionalProperties:
type: array
items:
type: object
properties:
vehicle:
type: string
datetime:
type: string
example:
{
51K: [
{ vehicle: "5732F", datetime: "2020-04-01T01:00:00Z"},
{ vehicle: "5736F", datetime: "2020-04-01T08:00:00Z"}
],
3T: [
{ vehicle: "360F", datetime: "2020-04-01T01:00:00Z"}
],
No.12: [
{ vehicle: "7802F+7702F", datetime: "2020-04-01T08:00:00Z"}
]
}
components:
schemas:
Error:
type: object
required:
- code
- message
properties:
code:
type: integer
format: int32
message:
type: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment