From b44450d8189a8a12ec4c43126726c90409fd1f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=BE=D0=B2=D0=B0=D0=BB=D0=B5=D0=B2=20=D0=93=D0=B5?= =?UTF-8?q?=D0=BE=D1=80=D0=B3=D0=B8=D0=B9=20=D0=90=D0=BB=D0=B5=D0=BA=D1=81?= =?UTF-8?q?=D0=B5=D0=B5=D0=B2=D0=B8=D1=87?= Date: Sun, 1 Sep 2024 14:33:14 +0500 Subject: [PATCH 1/2] fixed readme --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 71d9e97..5bc077f 100644 --- a/README.md +++ b/README.md @@ -210,9 +210,9 @@ json.jsonAs[Session] == Right(session) session.asJson == json ``` -## Sealed traits and enums +### Sealed traits and enums To derive **JsonReader** you **must** provide a discriminator. -This can be done via **selector** annotation +This can be done via **selector** annotation. Discriminator for **JsonWriter** is optional. If you don't need readers/writers for subtypes, you can omit them, @@ -388,7 +388,7 @@ case object Direction extends Enum[Direction] ### migration notes When migrating to **scala 3** you should use **0.28.1** version. -Scala 3 derivation API in **1.0.0** has a lot of deprecations and is not fully compatible with **0.28.1**, including: +Scala 3 derivation API in **0.29.0** has a lot of deprecations and is not fully compatible in compile time with **0.28.4**, including: 1. **WriterDescription** and **ReaderDescription** are deprecated along with **describe** macro. You can use **WriterBuilder** and **ReaderBuilder** directly instead @@ -407,7 +407,7 @@ Scala 3 derivation API in **1.0.0** has a lot of deprecations and is not fully c .extract(_.i).from(_.d).and[Double]("e")((d, e) => (d + e).toInt) ``` -3. **0.28.1 scala 3 enum support** will not compile to prevent runtime effects during migration +3. **0.28.4 scala 3 enum support** will not compile to prevent runtime effects during migration 4. `updatePartial` for **WriterBuilder** is deprecated. You can use ```update``` instead @@ -417,7 +417,7 @@ Scala 3 derivation API in **1.0.0** has a lot of deprecations and is not fully c * WriterBuilder * ReaderBuilder -6. **auto** derivation is removed +6. **auto** derivation is deprecated and not compile for recursive types. Use derives on toplevel type instead ### Quick start From 545095efd8687c0124dc48cede14db93df1a6c5a Mon Sep 17 00:00:00 2001 From: Vadim Chelyshov Date: Tue, 3 Sep 2024 13:00:53 +0400 Subject: [PATCH 2/2] docs_additions (#5) Co-authored-by: Vadim Chelyshov --- README.md | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 5bc077f..abd995c 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,13 @@ It's advantages: * Configurable recursive semiauto derivation * Discriminator support for sum types derivation - +Read more about library usage bellow: +- [Scala 3](https://github.com/tethys-json/tethys?tab=readme-ov-file#scala-3) +- [Scala 2](https://github.com/tethys-json/tethys?tab=readme-ov-file#scala-2) + + +# Scala 3 + ## Quick start ```scala @@ -383,15 +389,14 @@ case object Direction extends Enum[Direction] ``` -## scala 2 +### Migration notes -### migration notes -When migrating to **scala 3** you should use **0.28.1** version. +When migrating to **scala 3** you should use **0.29.0** version. Scala 3 derivation API in **0.29.0** has a lot of deprecations and is not fully compatible in compile time with **0.28.4**, including: 1. **WriterDescription** and **ReaderDescription** are deprecated along with **describe** macro. - You can use **WriterBuilder** and **ReaderBuilder** directly instead + Use **WriterBuilder** and **ReaderBuilder** directly instead 2. **DependentField** model for **ReaderBuilder** has changed. @@ -407,20 +412,21 @@ Scala 3 derivation API in **0.29.0** has a lot of deprecations and is not fully .extract(_.i).from(_.d).and[Double]("e")((d, e) => (d + e).toInt) ``` -3. **0.28.4 scala 3 enum support** will not compile to prevent runtime effects during migration +3. **0.28.4 scala 3 enum support** was changed. [See more](https://github.com/tethys-json/tethys?tab=readme-ov-file#basic-enums) -4. `updatePartial` for **WriterBuilder** is deprecated. You can use ```update``` instead +4. `updatePartial` for **WriterBuilder** is deprecated. Use ```update``` instead -5. all derivation api is moved directly into core module in **tethys** package, including +5. all derivation api were moved directly into core module in **tethys** package, including * FieldStyle * WriterBuilder * ReaderBuilder -6. **auto** derivation is deprecated and not compile for recursive types. Use derives on toplevel type instead +6. **auto** derivation is deprecated. Use derives on toplevel type instead +# Scala 2 -### Quick start +## Quick start Add dependencies to your `build.sbt` ```scala