Prepare release 1.0.4

This commit is contained in:
Cristi Vîjdea
2017-12-16 18:18:21 +01:00
committed by GitHub
parent 73bd7a136d
commit a2c21539f7
8 changed files with 71 additions and 24 deletions
+8 -2
View File
@@ -380,7 +380,7 @@ paths:
- name: data
in: body
required: true
schema: &id001
schema:
required:
- username
type: object
@@ -390,7 +390,13 @@ paths:
responses:
'201':
description: ''
schema: *id001
schema:
required:
- username
type: object
properties:
username:
type: string
consumes:
- application/json
tags:
+9 -1
View File
@@ -40,10 +40,18 @@ def test_json_codec_roundtrip(codec_json, generator, validate_schema):
def test_yaml_codec_roundtrip(codec_yaml, generator, validate_schema):
swagger = generator.get_schema(None, True)
yaml_bytes = codec_yaml.encode(swagger)
assert b'omap' not in yaml_bytes
assert b'omap' not in yaml_bytes # ensure no ugly !!omap is outputted
assert b'&id' not in yaml_bytes and b'*id' not in yaml_bytes # ensure no YAML references are generated
validate_schema(yaml.safe_load(yaml_bytes.decode('utf-8')))
def test_yaml_and_json_match(codec_yaml, codec_json, generator):
swagger = generator.get_schema(None, True)
yaml_schema = yaml.safe_load(codec_yaml.encode(swagger).decode('utf-8'))
json_schema = json.loads(codec_json.encode(swagger).decode('utf-8'))
assert yaml_schema == json_schema
def test_basepath_only():
generator = OpenAPISchemaGenerator(
info=openapi.Info(title="Test generator", default_version="v1"),