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

Make jsoniter a required dependency and use it for enc/dec in tapir adapters #2341

Merged
merged 6 commits into from
Sep 15, 2024

Conversation

kyri-petrou
Copy link
Collaborator

@kyri-petrou kyri-petrou commented Jul 17, 2024

As discussed on Discord, this is an attempt to improve/simplify UX by using jsoniter as the only JSON encoding/decoding implementation for requests/responses.

Since the users are not expected to provide custom codecs for requests/responses (in fact, most of the time they shouldn't even have to know of the existence of GraphQLRequest / GraphQLResponse), giving them an option of providing custom codecs is highly redundant and increases complexity.

With the changes in this PR, users no longer need to add a tapir-json-* dependency, and they no longer need to add any imports where they create the HttpInterpreter. Plus, this makes it easier for us to maintain this project in the longer term, as evident by this 👇

image

@kyri-petrou kyri-petrou added the breaking change The PR contains binary incompatible changes label Jul 17, 2024
# Conflicts:
#	adapters/akka-http/src/main/scala/caliban/AkkaHttpAdapter.scala
#	adapters/pekko-http/src/main/scala/caliban/PekkoHttpAdapter.scala
#	adapters/play/src/main/scala/caliban/PlayAdapter.scala
#	build.sbt
#	interop/tapir/src/main/scala/caliban/interop/tapir/HttpInterpreter.scala
Copy link
Owner

@ghostdogpr ghostdogpr left a comment

Choose a reason for hiding this comment

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

Can you make a separate PR for updating the docs?

@kyri-petrou
Copy link
Collaborator Author

Can you make a separate PR for updating the docs?

Sure will do

@kyri-petrou kyri-petrou merged commit 18dada3 into series/2.x Sep 15, 2024
11 checks passed
@kyri-petrou kyri-petrou deleted the jsoniter-only-encoders-decoders branch September 15, 2024 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change The PR contains binary incompatible changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants