110 lines
2.6 KiB
YAML
110 lines
2.6 KiB
YAML
components:
|
|
schemas:
|
|
web.APIError:
|
|
properties:
|
|
errorCode:
|
|
type: integer
|
|
errorMessage:
|
|
type: string
|
|
type: object
|
|
externalDocs:
|
|
description: ""
|
|
url: ""
|
|
info:
|
|
contact:
|
|
email: support@swagger.io
|
|
name: API Support
|
|
url: http://www.swagger.io/support
|
|
description: This is a sample server Petstore server.
|
|
license:
|
|
name: Apache 2.0
|
|
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
|
termsOfService: http://swagger.io/terms/
|
|
title: Swagger Example API
|
|
version: "1.0"
|
|
openapi: 3.1.0
|
|
paths:
|
|
/testapi/get-string-by-int/{some_id}:
|
|
get:
|
|
description: get string by ID
|
|
parameters:
|
|
- description: Some ID
|
|
in: path
|
|
name: some_id
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
responses:
|
|
"200":
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: string
|
|
description: ok
|
|
"400":
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/web.APIError'
|
|
description: We need ID!!
|
|
"404":
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/web.APIError'
|
|
description: Can not find ID
|
|
summary: Add a new pet to the store
|
|
/testapi/get-struct-array-by-string/{some_id}:
|
|
get:
|
|
description: get struct array by ID
|
|
parameters:
|
|
- description: Some ID
|
|
in: path
|
|
name: some_id
|
|
required: true
|
|
schema:
|
|
type: string
|
|
- description: Offset
|
|
in: query
|
|
name: offset
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
- description: Limit
|
|
in: query
|
|
name: limit
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
responses:
|
|
"200":
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: string
|
|
description: ok
|
|
"400":
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/web.APIError'
|
|
description: We need ID!!
|
|
"404":
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/web.APIError'
|
|
description: Can not find ID
|
|
servers:
|
|
- url: petstore.swagger.io:8080/v2
|