-
Couldn't load subscription status.
- Fork 30
Description
As previously raised in #181 and (partially) fixed in #182, the type property of item/collection links are limited to a specific subset, ie:
stac-pydantic/stac_pydantic/shared.py
Lines 46 to 73 in 270a7da
| geotiff = "image/tiff; application=geotiff" | |
| cog = "image/tiff; application=geotiff; profile=cloud-optimized" | |
| jp2 = "image/jp2" | |
| png = "image/png" | |
| jpeg = "image/jpeg" | |
| # Vector | |
| geojson = "application/geo+json" | |
| geojsonseq = "application/geo+json-seq" | |
| geopackage = "application/geopackage+sqlite3" | |
| kml = "application/vnd.google-earth.kml+xml" | |
| kmz = "application/vnd.google-earth.kmz" | |
| pbf = "application/x-protobuf" | |
| mvt = "application/vnd.mapbox-vector-tile" | |
| # Others | |
| hdf = "application/x-hdf" | |
| hdf5 = "application/x-hdf5" | |
| xml = "application/xml" | |
| json = "application/json" | |
| ndjson = "application/ndjson" | |
| html = "text/html" | |
| text = "text/plain" | |
| openapi = "application/vnd.oai.openapi+json;version=3.0" | |
| openapi_yaml = "application/vnd.oai.openapi;version=3.0" | |
| jsonschema = "application/schema+json" | |
| pdf = "application/pdf" | |
| csv = "text/csv" | |
| parquet = "application/vnd.apache.parquet" | |
| octet_stream = "application/octet-stream" |
We are trying to integrate link references that contains application/x-netcdf type, and the STAC-FastAPI refuses the pushed STAC Item because of this. I would expect many more types to be causing problem, such as text/markdown, text/x-rst, application/vnd.restful+json, etc.
Therefore, the fix should be revisited, either to allow any types, but preferably with a string pattern check, to avoid revisiting this again when yet another type is needed later on. A potential pattern could be something similar to [\w-]+/[\w\-.]+\s*(;.+)* to allow the type/subtype check, and the optional parameters (eg: profile=cloud-optimized, charset=UTF-8, etc.).