Skip to content

Commit

Permalink
Merge branch 'develop' into feature/yaml-support
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma authored Jul 22, 2024
2 parents ccf7697 + 4759759 commit 5f84d5b
Showing 1 changed file with 32 additions and 34 deletions.
66 changes: 32 additions & 34 deletions src/validation/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,22 +297,22 @@ class StatsRequestParams(BaseModel, GeometryValidatorMixin):
max_length=3,
example="NPL",
)
geometry: Optional[Union[Polygon, MultiPolygon, Feature, FeatureCollection]] = (
Field(
default=None,
example={
"type": "Polygon",
"coordinates": [
[
[83.96919250488281, 28.194446860487773],
[83.99751663208006, 28.194446860487773],
[83.99751663208006, 28.214869548073377],
[83.96919250488281, 28.214869548073377],
[83.96919250488281, 28.194446860487773],
]
],
},
)
geometry: Optional[
Union[Polygon, MultiPolygon, Feature, FeatureCollection]
] = Field(
default=None,
example={
"type": "Polygon",
"coordinates": [
[
[83.96919250488281, 28.194446860487773],
[83.99751663208006, 28.194446860487773],
[83.99751663208006, 28.214869548073377],
[83.96919250488281, 28.214869548073377],
[83.96919250488281, 28.194446860487773],
]
],
},
)

@validator("geometry", pre=True, always=True)
Expand Down Expand Up @@ -597,7 +597,6 @@ class CategoriesBase(BaseModel):
],
)


class DynamicCategoriesModel(CategoriesBase, GeometryValidatorMixin):
"""
Model for dynamic categories.
Expand All @@ -618,23 +617,22 @@ class DynamicCategoriesModel(CategoriesBase, GeometryValidatorMixin):
max_length=3,
example="USA",
)

geometry: Optional[Union[Polygon, MultiPolygon, Feature, FeatureCollection]] = (
Field(
default=None,
example={
"type": "Polygon",
"coordinates": [
[
[83.96919250488281, 28.194446860487773],
[83.99751663208006, 28.194446860487773],
[83.99751663208006, 28.214869548073377],
[83.96919250488281, 28.214869548073377],
[83.96919250488281, 28.194446860487773],
]
],
},
)
geometry: Optional[
Union[Polygon, MultiPolygon, Feature, FeatureCollection]
] = Field(
default=None,
example={
"type": "Polygon",
"coordinates": [
[
[83.96919250488281, 28.194446860487773],
[83.99751663208006, 28.194446860487773],
[83.99751663208006, 28.214869548073377],
[83.96919250488281, 28.214869548073377],
[83.96919250488281, 28.194446860487773],
]
],
},
)

@validator("geometry", pre=True, always=True)
Expand Down

0 comments on commit 5f84d5b

Please sign in to comment.