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
|
# In this one we make sure arrays without items are detected by validation
# Conversely, objects with items are detected with fixture for issue #1238
swagger: '2.0'
info:
title: issue-1171
version: 0.0.1
license:
name: MIT
host: localhost:8081
basePath: /api/v1
schemes:
- http
consumes:
- application/json
produces:
- application/json
paths:
'/servers/{server_id}/zones':
get:
operationId: listZones
tags:
- zones
parameters:
- name: server_id
in: path
required: true
type: string
- name: other_server_id
in: path
schema:
# Invalid array definition
type: array
properties:
other:
type: string
responses:
'200':
description: An array of Zones
schema:
$ref: '#/definitions/Zones'
'/server/getBody':
get:
operationId: getBody
parameters:
- name: yet_other_server_id
in: body
schema:
# Invalid array definition
type: array
properties:
other:
type: string
# param should be named?
- thestreetwithnoname: storyOfTheStreetsAreMine
in: body
type: integer
responses:
'200':
schema:
$ref: '#/definitions/Zones'
'/servers/{server_id}/zones/{zone_id}':
get:
operationId: listZone
tags:
- zones
parameters:
- name: server_id
in: path
required: true
type: string
- name: zone_id
type: string
in: path
required: true
responses:
'200':
description: A Zone
schema:
$ref: '#/definitions/Zone'
'201':
description: An invalid Zone
schema:
$ref: '#/definitions/InvalidZone'
'203':
description: An empty Zone
schema:
$ref: '#/definitions/EmptyZone'
definitions:
# An array must have an items definition
Zones:
type: array
properties:
name:
type: string
Zone:
type: array
items:
type: string
InvalidZone:
type: array
items:
# This is a forbidden property
name:
type: string
EmptyZone:
type: array
# Empty description: no error
items:
|