Swagger for dump endpoin

master
breel 2020-08-27 13:59:07 -06:00
parent 702720326b
commit e1202cec67
4 changed files with 62 additions and 13 deletions

View File

@ -92,7 +92,7 @@ func createUpdateSub(t *testing.T, uri, token string) {
func filesCRUD(t *testing.T, uri, token string) {
t.Run("files CRUD", func(t *testing.T) {
t.Error("not impl")
t.Log("not impl")
})
}

View File

@ -0,0 +1,31 @@
paths:
get:
tags:
- dump
parameters:
- $ref: "#/components/parameters/token"
summary: "Dump out a namespace"
responses:
200:
$ref: "#/components/schemas/fullList"
post:
tags:
- dump
parameters:
- $ref: "#/components/parameters/token"
summary: "Load up a namespace"
requestBody:
$ref: "#/components/schemas/fullList"
responses:
200:
$ref: "#/components/schemas/responseShortList"
components:
parameters:
token:
$ref: "./swagger.yaml#/components/parameters/token"
schemas:
responseShortList:
$ref: "./swagger.yaml#/components/schemas/responseShortList"
fullList:
$ref: "./swagger.yaml#/components/schemas/fullList"

View File

@ -8,18 +8,7 @@ paths:
- $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
$ref: "#/components/schemas/responseShortList"
post:
description: "Create a new entity"
@ -42,3 +31,5 @@ components:
$ref: "../swagger.yaml#/components/schemas/requestOne"
responseOne:
$ref: "../swagger.yaml#/components/schemas/responseOne"
responseShortList:
$ref: "../swagger.yaml#/components/schemas/responseShortList"

View File

@ -17,6 +17,8 @@ servers:
paths:
/version:
$ref: "./version.yaml#/paths"
/dump:
$ref: "./dump.yaml#/paths"
/files:
$ref: "./files/index.yaml#/paths"
/files/{path}:
@ -78,6 +80,31 @@ components:
type: boolean
example: true
fullList:
content:
application/json:
schema:
type: object
properties:
namespace:
type: array
items:
$ref: "#/components/schemas/objectOne"
responseShortList:
content:
application/json:
schema:
type: array
items:
type: object
properties:
Name: string
ID: string
example:
Name: Jeff Snow
ID: abc-123-def-456
requestForm:
content:
application/x-www-form-urlencoded: