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

Add toString() implementations #269

Merged
merged 1 commit into from
May 3, 2022
Merged

Add toString() implementations #269

merged 1 commit into from
May 3, 2022

Conversation

swallez
Copy link
Member

@swallez swallez commented May 3, 2022

Adds toString() implementations to all classes:

  • for requests it outputs the request method, URL path & parameters, body as JSON
  • for all other classes it outputs the JSON representation of the object

For classes containing user-defined objects like an indexing request or a search response, these object's toString() result is output as a JSON string value. The reason for that is because in toString() we don't have access to the JsonpMapper that defines how to serialize user-defined classes.

Fixes #97, part of #101

@swallez swallez merged commit 8e4db1d into main May 3, 2022
@swallez swallez deleted the add-to-string branch May 3, 2022 09:46
@github-actions
Copy link

github-actions bot commented May 3, 2022

The backport to 7.17 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-7.17 7.17
# Navigate to the new working tree
cd .worktrees/backport-7.17
# Create a new branch
git switch --create backport-269-to-7.17
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick --mainline 1 8e4db1dea8897d3acfca72ab501be7c0bca91e5b
# Push it to GitHub
git push --set-upstream origin backport-269-to-7.17
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-7.17

Then, create a pull request where the base branch is 7.17 and the compare/head branch is backport-269-to-7.17.

github-actions bot pushed a commit that referenced this pull request May 3, 2022
swallez added a commit that referenced this pull request May 3, 2022
Co-authored-by: Sylvain Wallez <sylvain@elastic.co>
@elastic elastic deleted a comment from github-actions bot May 3, 2022
swallez added a commit that referenced this pull request May 3, 2022
swallez added a commit that referenced this pull request May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to print search query?
1 participant