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

#8 ♻️ Restructure JSON deserialisation to enable other implementations than Circe #351

Merged
merged 15 commits into from
Feb 28, 2023

Conversation

jwojnowski
Copy link
Contributor

@jwojnowski jwojnowski commented Feb 10, 2023

I've extracted Circe decoders to an external module via a thin abstraction layer of EntityDecoder as a preparation for #8.

TODO

  • Docs update (additional JSON module, necessary import, changelog)
  • Moving tests strictly related to decoding to the Circe module
  • jsoniter-scala module

Open points:

  1. Scope Audience currently has an encoder, but I couldn't find any usages. I've removed it in this PR, but would be good to double-check whether that's OK.
  2. There are tests of the main module (oauth2) which depend on the decoders. I can see three options here:
    1. Making the oauth2 % test depend on oauth2-circe % compile, which depends on oauth2 % compile. This might not strictly be a dependency loop, but still looks a bit odd and risky. Fortunately, SBT resolves that issue by failing with a StackOverflow (a hidden one, naturally).
    2. Separating the core module for decodable entities (done in this PR), with JSON-related modules relying only on core, allowing main tests to depend on one of the JSON modules.
    3. Creating a separate module for tests, allowing them to depend on oauth2 and one of the JSON modules without a loop.

build.sbt Outdated Show resolved Hide resolved
@jwojnowski jwojnowski force-pushed the restructure-json-deserialisation branch from 8c8000b to c9c362b Compare February 14, 2023 16:27
@majk-p
Copy link
Member

majk-p commented Feb 17, 2023

Regarding the open point on the Audience encoder - let's drop it. This library is intended as a client for OAuth2 providers, thus it only needs to understand how to decode the data, it should not need the encoder. Let's drop it for now and see if it happens to be a problem when early adopters attempt to use RC version.

docs/migrating.md Outdated Show resolved Hide resolved
@jwojnowski jwojnowski force-pushed the restructure-json-deserialisation branch from 4225d39 to 69c6967 Compare February 23, 2023 20:55
@jwojnowski jwojnowski force-pushed the restructure-json-deserialisation branch from 8c9db7d to 0fd5d25 Compare February 24, 2023 09:01
@jwojnowski jwojnowski force-pushed the restructure-json-deserialisation branch from 7da53ec to 804b77e Compare February 24, 2023 11:05
Macro-generated code uses deprecated methods:
```
.../com/github/plokhotnyuk/jsoniter_scala/macros/JsonCodecMaker.scala: method isEmpty in class IterableOnceExtensionMethods is deprecated since 2.13.0: Use .iterator.isEmpty instead
```
@jwojnowski jwojnowski force-pushed the restructure-json-deserialisation branch from 804b77e to c02a882 Compare February 24, 2023 11:09
@jwojnowski jwojnowski marked this pull request as ready for review February 24, 2023 11:32
Copy link
Member

@majk-p majk-p left a comment

Choose a reason for hiding this comment

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

LGTM and publish as an RC

@matwojcik matwojcik self-requested a review February 28, 2023 10:54
@majk-p majk-p merged commit 76f7aa2 into polyvariant:main Feb 28, 2023
@majk-p majk-p mentioned this pull request Feb 28, 2023
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.

None yet

3 participants