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
|
properties[field.field_name] = schema
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
|
'type': 'object',
|
||||||
'properties': properties
|
'properties': properties
|
||||||
}
|
}
|
||||||
if required:
|
if required:
|
||||||
|
|
|
@ -335,6 +335,7 @@ class TestOperationIntrospection(TestCase):
|
||||||
'schema': {
|
'schema': {
|
||||||
'type': 'array',
|
'type': 'array',
|
||||||
'items': {
|
'items': {
|
||||||
|
'type': 'object',
|
||||||
'properties': {
|
'properties': {
|
||||||
'text': {
|
'text': {
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
|
@ -386,6 +387,7 @@ class TestOperationIntrospection(TestCase):
|
||||||
'item': {
|
'item': {
|
||||||
'type': 'array',
|
'type': 'array',
|
||||||
'items': {
|
'items': {
|
||||||
|
'type': 'object',
|
||||||
'properties': {
|
'properties': {
|
||||||
'text': {
|
'text': {
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
|
@ -532,6 +534,7 @@ class TestOperationIntrospection(TestCase):
|
||||||
'content': {
|
'content': {
|
||||||
'application/json': {
|
'application/json': {
|
||||||
'schema': {
|
'schema': {
|
||||||
|
'type': 'object',
|
||||||
'properties': {
|
'properties': {
|
||||||
'text': {
|
'text': {
|
||||||
'type': 'string',
|
'type': 'string',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user