mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 00:49:49 +03:00
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:
parent
bc4d52558b
commit
b698cf1fd8
|
@ -413,6 +413,7 @@ class AutoSchema(ViewInspector):
|
|||
properties[field.field_name] = schema
|
||||
|
||||
result = {
|
||||
'type': 'object',
|
||||
'properties': properties
|
||||
}
|
||||
if required:
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue
Block a user