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

feat: return invalid document in error message #248

Merged
merged 46 commits into from
Jan 23, 2023
Merged

feat: return invalid document in error message #248

merged 46 commits into from
Jan 23, 2023

Conversation

y-lakhdar
Copy link
Contributor

@y-lakhdar y-lakhdar commented Dec 21, 2022

Return the invalid document in the error message.

Before:

path/to/document.json is not a valid JSON: Document contains an invalid value for title: value is required.
Helpful links on the expected JSON format:
 • JSON file example: https://github.com/coveo/push-api-client.js/tree/main/samples/json
 • Document Body reference: https://docs.coveo.com/en/75#documentbody"

Now:

path/to/document.json is not a valid JSON: Document contains an invalid value for title: value is required.
Document in error:
{
  "DocumentId": "https://www.example.com/bar",
  "Broken_title": "Bar"
}

Helpful links on the expected JSON format:
 • JSON file example: https://github.com/coveo/push-api-client.js/tree/main/samples/json
 • Document Body reference: https://docs.coveo.com/en/75#documentbody"

@y-lakhdar y-lakhdar marked this pull request as ready for review December 21, 2022 19:13
Copy link
Collaborator

@louis-bompart louis-bompart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm overall,
nitpik on cloning
💡 about zod maybe maybe maybe

src/validation/caseInsensitiveDocument.ts Show resolved Hide resolved
src/validation/parsePermissions.ts Show resolved Hide resolved
@y-lakhdar y-lakhdar requested a review from a team as a code owner January 20, 2023 18:18
@y-lakhdar y-lakhdar requested review from btaillon-coveo and removed request for a team January 20, 2023 18:18
Base automatically changed from CDX-1283 to main January 23, 2023 20:33
@y-lakhdar y-lakhdar merged commit 4db778a into main Jan 23, 2023
@y-lakhdar y-lakhdar deleted the CDX-1284 branch January 23, 2023 20:35
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