Skip to content

Commit 921ca0f

Browse files
use titiler custom JSONResponse to handle NaN values (#659)
1 parent fb49341 commit 921ca0f

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release Notes
22

3+
## Next (TDB)
4+
5+
### titiler.extensions
6+
7+
* use TiTiler's custom JSONResponse for the `/validate` endpoint to avoid issue when COG has `NaN` nodata value
8+
39
## 0.11.7 (2023-05-18)
410

511
### titiler.core

src/titiler/extensions/titiler/extensions/cogeo.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from fastapi import Depends, Query
66

77
from titiler.core.factory import BaseTilerFactory, FactoryExtension
8+
from titiler.core.resources.responses import JSONResponse
89

910
try:
1011
from rio_cogeo.cogeo import cog_info
@@ -25,7 +26,11 @@ def register(self, factory: BaseTilerFactory):
2526
cog_info is not None
2627
), "'rio_cogeo' must be installed to use CogValidateExtension"
2728

28-
@factory.router.get("/validate", response_model=Info)
29+
@factory.router.get(
30+
"/validate",
31+
response_model=Info,
32+
response_class=JSONResponse,
33+
)
2934
def validate(
3035
src_path: str = Depends(factory.path_dependency),
3136
strict: bool = Query(False, description="Treat warnings as errors"),

0 commit comments

Comments
 (0)