@@ -756,12 +756,18 @@ def test_with_required(self, api):
756
756
def test_with_description (self , api ):
757
757
nested_fields = api .model ('NestedModel' , {'name' : fields .String })
758
758
field = fields .Nested (nested_fields , description = 'A description' )
759
- assert field .__schema__ == {'$ref' : '#/definitions/NestedModel' , 'description' : 'A description' }
759
+ assert field .__schema__ == {
760
+ 'description' : 'A description' ,
761
+ 'allOf' : [{'$ref' : '#/definitions/NestedModel' }]
762
+ }
760
763
761
764
def test_with_title (self , api ):
762
765
nested_fields = api .model ('NestedModel' , {'name' : fields .String })
763
766
field = fields .Nested (nested_fields , title = 'A title' )
764
- assert field .__schema__ == {'$ref' : '#/definitions/NestedModel' , 'title' : 'A title' }
767
+ assert field .__schema__ == {
768
+ 'title' : 'A title' ,
769
+ 'allOf' : [{'$ref' : '#/definitions/NestedModel' }]
770
+ }
765
771
766
772
def test_with_allow_null (self , api ):
767
773
nested_fields = api .model ('NestedModel' , {'name' : fields .String })
@@ -781,7 +787,10 @@ def test_with_readonly(self, app):
781
787
api = Api (app )
782
788
nested_fields = api .model ('NestedModel' , {'name' : fields .String })
783
789
field = fields .Nested (nested_fields , readonly = True )
784
- assert field .__schema__ == {'$ref' : '#/definitions/NestedModel' , 'readOnly' : True }
790
+ assert field .__schema__ == {
791
+ 'readOnly' : True ,
792
+ 'allOf' : [{'$ref' : '#/definitions/NestedModel' }]
793
+ }
785
794
786
795
def test_as_list (self , api ):
787
796
nested_fields = api .model ('NestedModel' , {'name' : fields .String })
0 commit comments