Hi,
Spec validation doesn't support a file type as a schema on responses and simply fails to validate:
swagger: "2.0"
info:
version: "1.0.0"
title: "Download app"
paths:
/download:
get:
summary: "Download a file"
produces:
- "application/pdf"
responses:
200:
description: OK
schema:
type: file
which is perfectly valid spec definition that you can confirm on https://editor.swagger.io/.
>>> from flex import load
>>> load('test.yml')
ValidationError Traceback (most recent call last)
<ipython-input-2-ba70e59f9805> in <module>()
----> 1 load('test.yml')
... // snip snip
ValidationError: 'paths':
- '/download':
- 'get':
- 'responses':
- 200:
- 'referenceObject':
- 'additionalProperties':
- "When `additionalProperties` is False, no unspecified properties are allowed. The following unspecified properties were found:\n\t`{'schema', 'description'}`"
- 'required':
- '$ref':
- 'This value is required'
- 'responseObject':
- 'schema':
- 'type':
- 'type':
- 'enum':
- "Invalid value. file is not one of the available options (['null', 'boolean', 'integer', 'number', 'string', 'array', 'object'])"
We can validate the same definition with no issues just by changing the type: file to type: string.
Hi,
Spec validation doesn't support a file type as a schema on responses and simply fails to validate:
which is perfectly valid spec definition that you can confirm on https://editor.swagger.io/.
We can validate the same definition with no issues just by changing the
type: filetotype: string.