Skip to content

Conversation

alnr
Copy link
Contributor

@alnr alnr commented May 16, 2025

Change Summary

When given return_doc=true in the query to the bulk import API, Typesense returns a valid JSON object in the document field of the response.

On failure (for example invalid JSON), the raw string from the request is echoed in the response instead.

This change makes the Go SDK compatible with that behavior.

I've also improved the implementation of (*documents) Import(). Previously, it ignored junk output appended to valid JSON. It now rejects anything but JSONL.

PR Checklist

When given return_doc=true in the query to the bulk import API, Typesense
returns a valid JSON object in the `document` field of the response.

On failure (for example invalid JSON), the raw string from the request is
echoed in the response instead.

This change makes the Go SDK compatible with that behavior.
haydenhoang added a commit to haydenhoang/typesense-go that referenced this pull request May 19, 2025
@haydenhoang
Copy link
Contributor

@jasonbosco I have added an integration test for this PR here, could you merge it?

Thanks for the fix @alnr!

@jasonbosco jasonbosco merged commit b71651b into typesense:master May 22, 2025
2 checks passed
jasonbosco added a commit that referenced this pull request May 22, 2025
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

Successfully merging this pull request may close these issues.

3 participants