Created
September 23, 2017 15:40
-
-
Save leetschau/5e5fa2f25e1e91ccfc32123205ca0b22 to your computer and use it in GitHub Desktop.
BOMS API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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