swagger OK resopnse bodies
This commit is contained in:
66
public/swagger/v1/entities/id.yaml
Normal file
66
public/swagger/v1/entities/id.yaml
Normal file
@@ -0,0 +1,66 @@
|
||||
paths:
|
||||
summary: "Interact with one entity within a namespace"
|
||||
delete:
|
||||
description: "Delete an existing entity"
|
||||
tags:
|
||||
- entities
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/token"
|
||||
- $ref: "#/components/parameters/id"
|
||||
responses:
|
||||
200:
|
||||
$ref: "#/components/schemas/responseOK"
|
||||
|
||||
get:
|
||||
description: "Get an existing entity"
|
||||
tags:
|
||||
- entities
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/token"
|
||||
- $ref: "#/components/parameters/id"
|
||||
responses:
|
||||
200:
|
||||
$ref: "#/components/schemas/responseOneResolved"
|
||||
|
||||
put:
|
||||
description: "Replace an existing entity"
|
||||
tags:
|
||||
- entities
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/token"
|
||||
- $ref: "#/components/parameters/id"
|
||||
requestBody:
|
||||
$ref: "#/components/schemas/requestOne"
|
||||
responses:
|
||||
200:
|
||||
$ref: "#/components/schemas/responseOne"
|
||||
|
||||
patch:
|
||||
description: "Update an existing entity"
|
||||
tags:
|
||||
- entities
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/token"
|
||||
- $ref: "#/components/parameters/id"
|
||||
requestBody:
|
||||
$ref: "#/components/schemas/requestOne"
|
||||
responses:
|
||||
200:
|
||||
$ref: "#/components/schemas/responseOne"
|
||||
|
||||
components:
|
||||
parameters:
|
||||
token:
|
||||
$ref: "../swagger.yaml#/components/parameters/token"
|
||||
id:
|
||||
$ref: "../swagger.yaml#/components/parameters/id"
|
||||
|
||||
schemas:
|
||||
requestOne:
|
||||
$ref: "../swagger.yaml#/components/schemas/requestOne"
|
||||
responseOne:
|
||||
$ref: "../swagger.yaml#/components/schemas/responseOne"
|
||||
responseOneResolved:
|
||||
$ref: "../swagger.yaml#/components/schemas/responseOneResolved"
|
||||
responseOK:
|
||||
$ref: "../swagger.yaml#/components/schemas/responseOK"
|
||||
71
public/swagger/v1/entities/idsub.yaml
Normal file
71
public/swagger/v1/entities/idsub.yaml
Normal file
@@ -0,0 +1,71 @@
|
||||
paths:
|
||||
summary: "Interact with one field of one entity within a namespace"
|
||||
delete:
|
||||
description: "Delete an existing entity's field's value"
|
||||
tags:
|
||||
- entities
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/token"
|
||||
- $ref: "#/components/parameters/id"
|
||||
- $ref: "#/components/parameters/path"
|
||||
responses:
|
||||
200:
|
||||
$ref: "#/components/schemas/responseOne"
|
||||
|
||||
get:
|
||||
description: "Get an existing entity's field's value"
|
||||
tags:
|
||||
- entities
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/token"
|
||||
- $ref: "#/components/parameters/id"
|
||||
- $ref: "#/components/parameters/path"
|
||||
responses:
|
||||
200:
|
||||
$ref: "#/components/schemas/responseOne"
|
||||
|
||||
put:
|
||||
description: "Replace an existing entity's field's value"
|
||||
tags:
|
||||
- entities
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/token"
|
||||
- $ref: "#/components/parameters/id"
|
||||
- $ref: "#/components/parameters/path"
|
||||
requestBody:
|
||||
$ref: "#/components/schemas/requestOne"
|
||||
responses:
|
||||
200:
|
||||
$ref: "#/components/schemas/responseOne"
|
||||
|
||||
patch:
|
||||
description: "Update an existing entity's field's value"
|
||||
tags:
|
||||
- entities
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/token"
|
||||
- $ref: "#/components/parameters/id"
|
||||
- $ref: "#/components/parameters/path"
|
||||
requestBody:
|
||||
$ref: "#/components/schemas/requestOne"
|
||||
responses:
|
||||
200:
|
||||
$ref: "#/components/schemas/responseOne"
|
||||
|
||||
components:
|
||||
parameters:
|
||||
token:
|
||||
$ref: "../swagger.yaml#/components/parameters/token"
|
||||
id:
|
||||
$ref: "../swagger.yaml#/components/parameters/id"
|
||||
path:
|
||||
$ref: "../swagger.yaml#/components/parameters/path"
|
||||
schemas:
|
||||
responseOne:
|
||||
$ref: "../swagger.yaml#/components/schemas/responseOne"
|
||||
requestOne:
|
||||
$ref: "../swagger.yaml#/components/schemas/requestOne"
|
||||
objectOne:
|
||||
$ref: "../swagger.yaml#/components/schemas/objectOne"
|
||||
responseOK:
|
||||
$ref: "../swagger.yaml#/components/schemas/responseOK"
|
||||
44
public/swagger/v1/entities/index.yaml
Normal file
44
public/swagger/v1/entities/index.yaml
Normal file
@@ -0,0 +1,44 @@
|
||||
paths:
|
||||
summary: "Interact with all entities within a namespace"
|
||||
get:
|
||||
description: "Get names and IDs of all entities"
|
||||
tags:
|
||||
- entities
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/token"
|
||||
responses:
|
||||
200:
|
||||
content:
|
||||
applicaiton/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
Name: string
|
||||
ID: string
|
||||
example:
|
||||
Name: John Smith
|
||||
ID: abc-123
|
||||
|
||||
post:
|
||||
description: "Create a new entity"
|
||||
tags:
|
||||
- entities
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/token"
|
||||
requestBody:
|
||||
$ref: "#/components/schemas/requestOne"
|
||||
responses:
|
||||
200:
|
||||
$ref: "#/components/schemas/responseOne"
|
||||
|
||||
components:
|
||||
parameters:
|
||||
token:
|
||||
$ref: "../swagger.yaml#/components/parameters/token"
|
||||
schemas:
|
||||
requestOne:
|
||||
$ref: "../swagger.yaml#/components/schemas/requestOne"
|
||||
responseOne:
|
||||
$ref: "../swagger.yaml#/components/schemas/responseOne"
|
||||
@@ -12,8 +12,7 @@ info:
|
||||
version: 0.1.0
|
||||
|
||||
servers:
|
||||
- url: http://api.dndex.lan:8080/
|
||||
- url: http://authapi.dndex.lan:8080/
|
||||
- url: http://api1.dndex.lan:8080/
|
||||
|
||||
paths:
|
||||
/version:
|
||||
@@ -24,11 +23,22 @@ paths:
|
||||
$ref: "./users/register.yaml#/paths"
|
||||
/users/login:
|
||||
$ref: "./users/login.yaml#/paths"
|
||||
#/entities:
|
||||
# $ref: "./entities.yaml#/paths"
|
||||
/entities:
|
||||
$ref: "./entities/index.yaml#/paths"
|
||||
/entities/{id}:
|
||||
$ref: "./entities/id.yaml#/paths"
|
||||
/entities/{id}/{path}:
|
||||
$ref: "./entities/idsub.yaml#/paths"
|
||||
|
||||
components:
|
||||
parameters:
|
||||
id:
|
||||
name: id
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
|
||||
path:
|
||||
name: path
|
||||
in: path
|
||||
@@ -44,13 +54,27 @@ components:
|
||||
type: string
|
||||
|
||||
schemas:
|
||||
responseOneResolved:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/objectOneResolved"
|
||||
|
||||
responseOne:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/objectOne"
|
||||
|
||||
responseOK:
|
||||
content:
|
||||
application/json:
|
||||
properties:
|
||||
ok:
|
||||
type: boolean
|
||||
example: true
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
ok:
|
||||
type: boolean
|
||||
example: true
|
||||
|
||||
requestForm:
|
||||
content:
|
||||
@@ -59,40 +83,53 @@ components:
|
||||
type: string
|
||||
example: http://imgur.com/big-tiddy-goth-gf.jpg
|
||||
|
||||
objectID:
|
||||
title: "one ID"
|
||||
type: string
|
||||
example: "abc-123-def-456"
|
||||
requestOne:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/objectOne"
|
||||
|
||||
objectOne:
|
||||
title: "one entity"
|
||||
oneID: { type: string, example: "abc-123-def-456" }
|
||||
oneName: { type: string, example: "Jeff Snow" }
|
||||
oneType: { type: string, example: "Doggo" }
|
||||
oneTitle: { type: string, example: "Meme Lord" }
|
||||
oneText: { type: string, example: "Lorem ipsum" }
|
||||
oneModified: { type: int, example: 1234567890 }
|
||||
oneAttachments:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: object
|
||||
properties:
|
||||
location:
|
||||
type: string
|
||||
example:
|
||||
"abc-123-def-456":
|
||||
location: "/__files__/my/file.txt"
|
||||
|
||||
objectOneResolved:
|
||||
type: object
|
||||
properties:
|
||||
_id:
|
||||
$ref: "/components/schemas/objectID"
|
||||
name:
|
||||
type: string
|
||||
example: "Jeff Snow"
|
||||
type:
|
||||
type: string
|
||||
example: "doggo"
|
||||
title:
|
||||
type: string
|
||||
example: "Meme Lord"
|
||||
text:
|
||||
type: string
|
||||
example: "Lorem ipsum"
|
||||
modified:
|
||||
type: int
|
||||
example: 8675309
|
||||
attachments:
|
||||
_id: { $ref: "#/components/schemas/oneID" }
|
||||
name: { $ref: "#/components/schemas/oneName" }
|
||||
type: { $ref: "#/components/schemas/oneType" }
|
||||
title: { $ref: "#/components/schemas/oneTitle" }
|
||||
text: { $ref: "#/components/schemas/oneText" }
|
||||
modified: { $ref: "#/components/schemas/oneModified" }
|
||||
attachments: { $ref: "#/components/schemas/oneAttachments" }
|
||||
connections:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: object
|
||||
properties:
|
||||
location:
|
||||
type: string
|
||||
example: "/files/my/file.txt"
|
||||
additionalProperties: { $ref: "#/components/schemas/objectOne" }
|
||||
|
||||
objectOne:
|
||||
type: object
|
||||
properties:
|
||||
_id: { $ref: "#/components/schemas/oneID" }
|
||||
name: { $ref: "#/components/schemas/oneName" }
|
||||
type: { $ref: "#/components/schemas/oneType" }
|
||||
title: { $ref: "#/components/schemas/oneTitle" }
|
||||
text: { $ref: "#/components/schemas/oneText" }
|
||||
modified: { $ref: "#/components/schemas/oneModified" }
|
||||
attachments: { $ref: "#/components/schemas/oneAttachments" }
|
||||
connections:
|
||||
type: object
|
||||
additionalProperties:
|
||||
@@ -100,7 +137,9 @@ components:
|
||||
properties:
|
||||
relationship:
|
||||
type: string
|
||||
example: "friendly"
|
||||
example:
|
||||
"abc-123-def-456":
|
||||
relationship: "friendly"
|
||||
|
||||
securitySchemes:
|
||||
token:
|
||||
|
||||
@@ -13,3 +13,16 @@ paths:
|
||||
DnDex-User:
|
||||
type: string
|
||||
example: "namespace"
|
||||
responses:
|
||||
200:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
token:
|
||||
type: string
|
||||
example: abc-123
|
||||
salt:
|
||||
type: string
|
||||
example: def-456
|
||||
|
||||
@@ -15,3 +15,11 @@ paths:
|
||||
DnDex-Auth:
|
||||
type: string
|
||||
example: "password"
|
||||
responses:
|
||||
200:
|
||||
$ref: "#/components/schemas/responseOK"
|
||||
|
||||
components:
|
||||
schemas:
|
||||
responseOK:
|
||||
$ref: "../swagger.yaml#/components/schemas/responseOK"
|
||||
|
||||
@@ -13,3 +13,4 @@ paths:
|
||||
version:
|
||||
type: string
|
||||
example: "02c5d795cf631a33528234a9cf52907c6cd34834"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user