Skip to content

Instantly share code, notes, and snippets.

@leetschau
Created September 23, 2017 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leetschau/5e5fa2f25e1e91ccfc32123205ca0b22 to your computer and use it in GitHub Desktop.
Save leetschau/5e5fa2f25e1e91ccfc32123205ca0b22 to your computer and use it in GitHub Desktop.
BOMS API
openapi: '3.0.0'
info:
title: BOMS API
description: BOMS API Specification
version: "0.1.1"
servers:
- url: localhost:8080
description: test server
paths:
/projects:
get:
description: List all projects
responses:
'200':
description: success
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Project'
example:
- id: 101
name: 广东风电
- id: 102
name: 国网财务分析
post:
description: Adds a new project
requestBody:
description: data describing the *new* added project
required: true
content:
'application/json':
schema:
$ref: '#/components/schemas/Project'
example:
$ref: '#/components/examples/project'
responses:
'201':
description: Project created
/projects/{id}:
get:
description: 读取项目内容
parameters:
- in: path
name: id
description: 项目ID
schema:
type: string
required: true
responses:
'200':
description: success
'404':
description: A project with the specified ID was not found.
put:
description: 更新项目内容
parameters:
- in: path
name: id
description: 项目ID
schema:
type: string
required: true
requestBody:
description: 项目内容
required: true
content:
'application/json':
schema:
$ref: '#/components/schemas/BOI'
example:
raw: {}
mdl: {}
prop: {}
con: {}
responses:
'200':
description: success
delete:
description: Deletes a project
parameters:
- in: path
name: id
description: 项目ID
required: true
schema:
type: string
responses:
'204':
description: Project deleted
'404':
description: Project not found
/projects/{id}/dataobj:
put:
description: 发布业务对象
parameters:
- in: path
name: id
description: 项目ID
required: true
schema:
type: string
responses:
'200':
description: 发布业务对象成功
'404':
description: 项目不存在
components:
examples:
project:
value:
id: 123
name: 广东风电
summary: A demo project
schemas:
Project:
type: object
properties:
id:
type: integer
format: int64
name:
type: string
required:
- id
- name
BOI:
type: object
properties:
raw:
type: string
mdl:
type: string
prop:
type: string
con:
type: string
required:
- raw
- mdl
- prop
- con
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment