-
-
Notifications
You must be signed in to change notification settings - Fork 560
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
Collision between /documents/id endpoint and /documents/export endpoint #13
Comments
Interesting. I don't like the idea of blacklisting Can we define the export end-point as |
Although, I think we should probably use the Content-Type header to indicate the format instead of putting it in the URL. May be |
Btw, we have the same conceptual problem with the search endpoint, but the server already handles this case fine:
So we've actually already blacklisted |
Here's an idea to solve both the export and search endpoints: GET GET The nice thing about this is that you could also export the results of a search in JSONL format. So it's the same endpoint serving both purposes. Let me know if this works and I can massage the Response data model appropriately in the spec. |
I just realized that we can handle this easily if we place the If this is fine, I will go ahead and re-order the routes. |
Yup, that works! |
Fixed - you can pull the docker image again and test. |
Yup, works 👍 I've updated the API spec in typesense/typesense-api-spec#3 |
Description
The possibility of this collision was in the back of my head when writing the API spec... Looks like it has indeed manifested itself in the implementation.
Currently, the URL to retrieve/delete a doc is
/collections/{collectionName}/documents/{documentId}
. So when you do a GET on/collections/{collectionName}/documents/export
it says "document with ID export is not found" instead of considering /export an action endpoint.Steps to reproduce
Expected Behavior
It should export all documents in the collection.
Actual Behavior
It considers
export
an ID and says the doucment isn't foundMetadata
Typsense Version: 0.8-api-changes
The text was updated successfully, but these errors were encountered: