88 lines
2.0 KiB
YAML
88 lines
2.0 KiB
YAML
basePath: /v2
|
|
definitions:
|
|
web.APIError:
|
|
properties:
|
|
errorCode:
|
|
type: integer
|
|
errorMessage:
|
|
type: string
|
|
type: object
|
|
host: petstore.swagger.io:8080
|
|
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"
|
|
paths:
|
|
/testapi/get-string-by-int/{some_id}:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: get string by ID
|
|
parameters:
|
|
- description: Some ID
|
|
in: path
|
|
name: some_id
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: ok
|
|
schema:
|
|
type: string
|
|
"400":
|
|
description: We need ID!!
|
|
schema:
|
|
$ref: '#/definitions/web.APIError'
|
|
"404":
|
|
description: Can not find ID
|
|
schema:
|
|
$ref: '#/definitions/web.APIError'
|
|
summary: Add a new pet to the store
|
|
/testapi/get-struct-array-by-string/{some_id}:
|
|
get:
|
|
consumes:
|
|
- application/json
|
|
description: get struct array by ID
|
|
parameters:
|
|
- description: Some ID
|
|
in: path
|
|
name: some_id
|
|
required: true
|
|
type: string
|
|
- description: Offset
|
|
in: query
|
|
name: offset
|
|
required: true
|
|
type: integer
|
|
- description: Offset
|
|
in: query
|
|
name: limit
|
|
required: true
|
|
type: integer
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: ok
|
|
schema:
|
|
type: string
|
|
"400":
|
|
description: We need ID!!
|
|
schema:
|
|
$ref: '#/definitions/web.APIError'
|
|
"404":
|
|
description: Can not find ID
|
|
schema:
|
|
$ref: '#/definitions/web.APIError'
|
|
swagger: "2.0"
|