Prepare release 1.0.4
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user