stac-fastapi.types 5.2.0__tar.gz → 5.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/PKG-INFO +1 -1
  2. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/stac_fastapi/types/search.py +11 -3
  3. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/stac_fastapi/types/version.py +1 -1
  4. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/stac_fastapi.types.egg-info/PKG-INFO +1 -1
  5. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/README.md +0 -0
  6. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/setup.cfg +0 -0
  7. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/setup.py +0 -0
  8. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/stac_fastapi/types/__init__.py +0 -0
  9. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/stac_fastapi/types/config.py +0 -0
  10. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/stac_fastapi/types/conformance.py +0 -0
  11. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/stac_fastapi/types/core.py +0 -0
  12. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/stac_fastapi/types/errors.py +0 -0
  13. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/stac_fastapi/types/extension.py +0 -0
  14. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/stac_fastapi/types/links.py +0 -0
  15. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/stac_fastapi/types/requests.py +0 -0
  16. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/stac_fastapi/types/rfc3339.py +0 -0
  17. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/stac_fastapi/types/stac.py +0 -0
  18. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/stac_fastapi.types.egg-info/SOURCES.txt +0 -0
  19. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/stac_fastapi.types.egg-info/dependency_links.txt +0 -0
  20. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/stac_fastapi.types.egg-info/not-zip-safe +0 -0
  21. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/stac_fastapi.types.egg-info/requires.txt +0 -0
  22. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/stac_fastapi.types.egg-info/top_level.txt +0 -0
  23. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/tests/test_config.py +0 -0
  24. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/tests/test_limit.py +0 -0
  25. {stac_fastapi_types-5.2.0 → stac_fastapi_types-5.2.1}/tests/test_rfc3339.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stac-fastapi.types
3
- Version: 5.2.0
3
+ Version: 5.2.1
4
4
  Summary: An implementation of STAC API based on the FastAPI framework.
5
5
  Home-page: https://github.com/stac-utils/stac-fastapi
6
6
  Author: Arturo Engineering
@@ -5,7 +5,7 @@ from datetime import datetime as dt
5
5
  from typing import Dict, List, Optional, Union
6
6
 
7
7
  import attr
8
- from fastapi import Query
8
+ from fastapi import HTTPException, Query
9
9
  from pydantic import Field, PositiveInt
10
10
  from pydantic.functional_validators import AfterValidator
11
11
  from stac_pydantic.api import Search
@@ -34,8 +34,16 @@ def str2list(x: str) -> Optional[List[str]]:
34
34
  def str2bbox(x: str) -> Optional[BBox]:
35
35
  """Convert string to BBox based on , delimiter."""
36
36
  if x:
37
- t = tuple(float(v) for v in x.split(","))
38
- assert len(t) in [4, 6], f"BBox '{x}' must have 4 or 6 values."
37
+ try:
38
+ t = tuple(float(v) for v in x.split(","))
39
+ except ValueError:
40
+ raise HTTPException(status_code=400, detail=f"invalid bbox: {x}")
41
+
42
+ if len(t) not in (4, 6):
43
+ raise HTTPException(
44
+ status_code=400, detail=f"BBox '{x}' must have 4 or 6 values."
45
+ )
46
+
39
47
  return t
40
48
 
41
49
  return None
@@ -1,3 +1,3 @@
1
1
  """Library version."""
2
2
 
3
- __version__ = "5.2.0"
3
+ __version__ = "5.2.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stac-fastapi.types
3
- Version: 5.2.0
3
+ Version: 5.2.1
4
4
  Summary: An implementation of STAC API based on the FastAPI framework.
5
5
  Home-page: https://github.com/stac-utils/stac-fastapi
6
6
  Author: Arturo Engineering