diff --git a/openapi.yml b/openapi.yml index 3031ba9a4..50312c1ce 100644 --- a/openapi.yml +++ b/openapi.yml @@ -4838,7 +4838,9 @@ components: type: string maxLength: 200 region: - $ref: '#/components/schemas/RegionSummary' + oneOf: + - $ref: '#/components/schemas/RegionSummary' + - type: 'null' names: type: array items: diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index 7105c9d25..f4c4809fa 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -1154,7 +1154,7 @@ class Meta: class LocationDetailSerializer(serializers.ModelSerializer[Location]): - region = RegionSummarySerializer() + region = RegionSummarySerializer(allow_null=True) names = LocationNameSerializer(many=True, read_only=True, source="locationname") game_indices = LocationGameIndexSerializer(many=True, read_only=True, source="locationgameindex") areas = LocationAreaSummarySerializer(many=True, read_only=True, source="locationarea")