Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileTypeInvalid vs FormatUnsuitable #505

Open
soxofaan opened this issue Aug 7, 2023 · 2 comments
Open

FileTypeInvalid vs FormatUnsuitable #505

soxofaan opened this issue Aug 7, 2023 · 2 comments

Comments

@soxofaan
Copy link
Member

soxofaan commented Aug 7, 2023

The API defines FileTypeInvalid

openeo-api/errors.json

Lines 162 to 168 in c5a45b4

"FileTypeInvalid": {
"description": "File format or file extension is not allowed.",
"message": "File format {type} not allowed. Allowed file formats: {types}",
"http": 400,
"tags": [
"File Management"
]

A couple openeo processes however define FormatUnsuitable: load_uploaded_files, load_url, save_result.

I wonder how useful FileTypeInvalid is actually. It's defined in openeo-api, becuase it's part of the file API, but why would certain file extensions or format (which implies inspection of the data) be forbidden in the phase of uploading a file? That seems like a pretty annoying feature of a file API.

If a back-end does not support loading the format at processing time, then it will throw FormatUnsuitable

@m-mohr
Copy link
Member

m-mohr commented Aug 7, 2023

FileTypeInvalid is for the /files endpoints (tag: "File Management"), the others are for specific processes.
I assumed some back-ends may want to restrict what users could upload, but maybe they don't?
Anyway, it doesn't hurt to have the error, no?

soxofaan added a commit to Open-EO/openeo-python-driver that referenced this issue Aug 7, 2023
@soxofaan
Copy link
Member Author

soxofaan commented Aug 7, 2023

back-ends may want to restrict what users could upload, but maybe they don't?

that just seems annoying. And users probably will circumvent it anyway (e.g. append .txt or .json extension just to get something uploaded)

Anyway, it doesn't hurt to have the error, no?

Well, its presence tricked me in using the wrong error code in the validation part of load_url 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants