rdblue commented on code in PR #15746:
URL: https://github.com/apache/iceberg/pull/15746#discussion_r2990465467


##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -162,6 +162,8 @@ paths:
           $ref: '#/components/responses/UnauthorizedResponse'
         403:
           $ref: '#/components/responses/ForbiddenResponse'
+        404:
+          $ref: '#/components/responses/NoSuchWarehouseResponse'

Review Comment:
   I agree with @danielcweeks that we need a way to distinguish what wasn't 
found, although I don't see why this doesn't just use our normal error response 
with an example. Here is one you can copy:
   
   ```
           404:
             description: Not Found - Namespace provided in the `parent` query 
parameter is not found.
             content:
               application/json:
                 schema:
                   $ref: '#/components/schemas/IcebergErrorResponse'
                 examples:
                   NoSuchNamespaceExample:
                     $ref: '#/components/examples/NoSuchNamespaceError'  <--- 
Your error goes here
   ```
   
   This doesn't require a new response object but does show how different 
missing objects can be represented.
   
   I also wonder if this is the right response. Doesn't 404 typically mean that 
the resource identified by the path doesn't exist? But the config resource 
exists and the warehouse is just a parameter that the config resource is 
providing information for. I could be wrong, but I thought that 404 implied 
that the thing identified by the path doesn't exist, not that there was a 
problem finding information for a different (and optional) object.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to