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

Directly use InputStream for parsing response JSON. #144

Merged
merged 17 commits into from
Sep 17, 2024

Conversation

findgriffin
Copy link
Contributor

@findgriffin findgriffin commented Sep 17, 2024

Description

This change is a big refactor and the main party trick is that we can use HttpResponse<InputStream and then pass that to FaunaParser instead of having to do toString -> ObjectMapper.read(..).

Some other things are mixed in here like some follow-on fixes from the previous PR #143 and the QueryTags parse method was incorrectly expecting an array, I've implemented an E2E test to verify that the a=b,c=d format is what we really get.

I expect to have a follow-on PR that will completely remove ConstraintFailureWire, ErrorInfoWire and QueryResponseWire, associated dead code, and refactor the tests. I stopped short of doing that in this PR because a lot of tests need to be changed.

Motivation and context

I started out with the goal of removing ObjectMapper and the associated *Wire classes (ConstraintFailureWire, ErrorInfoWire, and QueryResponseWire) and I didn't get all the way there, but this PR is already pretty big.

How was the change tested?

Many modified unit tests, and I added some E2E tests.

Screenshots (if appropriate):

Change types

    • Bug fix (non-breaking change that fixes an issue)
    • New feature (non-breaking change that adds functionality)
    • Breaking change (backwards-incompatible fix or feature)

Checklist:

    • My code follows the code style of this project.
    • My change requires a change to Fauna documentation.
    • My change requires a change to the README, and I have updated it accordingly.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@findgriffin findgriffin changed the title [remove-object-mapper] Directly use InputStream for parsing response JSON. Sep 17, 2024
@findgriffin findgriffin marked this pull request as ready for review September 17, 2024 01:11
Copy link
Collaborator

@pnwpedro pnwpedro left a comment

Choose a reason for hiding this comment

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

A few required and a few optional pieces of feedback.

In the desc, you say:

QueryTags parse method was incorrectly expecting an array

I don't see a parse method in main. AFAICT, the QueryTags deserializer was doing the right thing expecting a comma-delimited key-value pair syntax (foo=bar,baz=moo)

@findgriffin findgriffin merged commit cd5b893 into main Sep 17, 2024
1 check passed
@findgriffin findgriffin deleted the remove-object-mapper branch September 17, 2024 22:32
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.

2 participants