yuqi1129 opened a new issue, #12879:
URL: https://github.com/apache/gravitino/issues/12879
### Version
main branch
### Describe what is wrong
REST resource methods map `UnsupportedOperationException` to HTTP 405
through `Utils.unsupportedOperation`. These requests use a valid HTTP method;
the target object or configured catalog simply does not support the operation.
HTTP 405 incorrectly tells clients that the method is invalid for the URI.
Requests with an incompatible metadata object type should return HTTP 400.
Requests for recognized but unavailable catalog or connector functionality
should return HTTP 501. The authorization-disabled filter can retain HTTP 405
because that API is unavailable by configuration.
### Error message and/or stacktrace
`GET /api/metalakes/{metalake}/objects/catalog/{catalog}/statistics` returns
HTTP 405 with `Listing statistics is only supported for tables now`.
`GET
/api/metalakes/{metalake}/objects/table/{catalog}.{schema}.{table}/statistics`
against a catalog without table support also returns HTTP 405 with `Catalog
does not support table operations`.
### How to reproduce
1. Run Apache Gravitino from the main branch.
2. Create a fileset catalog.
3. Call the two GET endpoints described above.
4. Observe HTTP 405 although GET is registered for both routes.
### Additional context
`server-common/src/main/java/org/apache/gravitino/server/web/Utils.java`
maps every unsupported operation to HTTP 405 and is reused by multiple REST
exception handlers.
Originally reported in
https://github.com/datastrato/gravitino-enterprise/issues/1674.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]