Update openapi.py to include a type of object to anything that requires 'properties' during schema generation (_map_serializer method). Also, fix unit tests.

This commit is contained in:
Kentalot 2020-01-29 11:41:33 -08:00
parent bc4d52558b
commit b698cf1fd8
2 changed files with 4 additions and 0 deletions

View File

@ -413,6 +413,7 @@ class AutoSchema(ViewInspector):
properties[field.field_name] = schema
result = {
'type': 'object',
'properties': properties
}
if required:

View File

@ -335,6 +335,7 @@ class TestOperationIntrospection(TestCase):
'schema': {
'type': 'array',
'items': {
'type': 'object',
'properties': {
'text': {
'type': 'string',
@ -386,6 +387,7 @@ class TestOperationIntrospection(TestCase):
'item': {
'type': 'array',
'items': {
'type': 'object',
'properties': {
'text': {
'type': 'string',
@ -532,6 +534,7 @@ class TestOperationIntrospection(TestCase):
'content': {
'application/json': {
'schema': {
'type': 'object',
'properties': {
'text': {
'type': 'string',