1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
|
swagger: '2.0'
################################################################################
# API Information #
################################################################################
info:
version: '1.0.0'
title: Test both cascading $refs and basePath
description: |
This definition use both cascading $refs and a "non empty" basePath
################################################################################
# Host, Base Path, Schemes and Content Types #
################################################################################
# The host (name or ip) serving the API
host: localhost:5000
# The base path on which the API is served, relative to the host. Will be prefixed to all paths. Used to control versioning
basePath: /api/
# The transfer protocol of the API
schemes:
- http
# Format of bodies a client can send (Content-Type)
consumes:
- application/json
# Format of the responses to the client (Accepts)
produces:
- application/json
################################################################################
# Paths #
################################################################################
paths:
/get_cost:
post:
summary: a test with cascading $refs
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: request
description: request
required: true
schema:
$ref: '#/definitions/GetCostRequest'
responses:
'200':
description: OK
schema:
type: array
items:
$ref: '#/definitions/GetCostResponse'
'201':
description: Created
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
deprecated: false
definitions:
GetCostResponse:
type: object
properties:
description:
type:
string
cost:
$ref: '#/definitions/Cost'
title: GetCost response
GetCostRequest:
type: object
properties:
level:
type: integer
location:
$ref: '#/definitions/Location'
title: GetCost Request
Cost:
type: object
properties:
currency:
type: string
description: cost currency (3-letters code)
value:
type: number
description: cost value
title: Cost
GeoPosition:
type: object
properties:
latitude:
type: number
format: double
description: latitude in float
longitude:
type: number
format: double
description: longitude in float
title: GeoPosition
Location:
type: object
properties:
name:
type: string
description: name of the location
position:
description: position of the location
$ref: '#/definitions/GeoPosition'
title: Location
|