mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-11-04 18:08:03 +03:00 
			
		
		
		
	Add failing test for ListField schema generation
				
					
				
			The `ListField` was generating a schema that contained `type=None` when a `ChoiceField` was the child, since we are not currently able to introspect the type of a `ChoiceField`.
This commit is contained in:
		
							parent
							
								
									496947be3a
								
							
						
					
					
						commit
						b1048984a7
					
				| 
						 | 
				
			
			@ -52,6 +52,8 @@ class TestFieldMapping(TestCase):
 | 
			
		|||
            (serializers.ListField(child=serializers.CharField()), {'items': {'type': 'string'}, 'type': 'array'}),
 | 
			
		||||
            (serializers.ListField(child=serializers.IntegerField(max_value=4294967295)),
 | 
			
		||||
             {'items': {'type': 'integer', 'format': 'int64'}, 'type': 'array'}),
 | 
			
		||||
            (serializers.ListField(child=serializers.ChoiceField(choices=[('a', 'Choice A'), ('b', 'Choice B')])),
 | 
			
		||||
             {'items': {'enum': ['a', 'b']}, 'type': 'array'}),
 | 
			
		||||
            (serializers.IntegerField(min_value=2147483648),
 | 
			
		||||
             {'type': 'integer', 'minimum': 2147483648, 'format': 'int64'}),
 | 
			
		||||
        ]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user