swagger OK resopnse bodies

This commit is contained in:
breel
2020-08-09 22:23:39 -06:00
parent f11261f0da
commit 4aea3dab40
9 changed files with 288 additions and 80 deletions

View File

@@ -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: