Skip to content

Commit d20a74d

Browse files
committed
[jwtk#719] README.md updates.
1 parent 5fa364a commit d20a74d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -1269,11 +1269,27 @@ They are checked in order, and the first one found is used:
12691269
Android applications _unless_ you want to use POJOs as claims. The `org.json` library supports simple
12701270
Object-to-JSON marshaling, but it *does not* support JSON-to-Object unmarshalling.
12711271
1272+
4. JSON-B: This will automatically be used if you specify `io.jsonwebtoken:jjwt-jsonb` as a project runtime dependency.
1273+
JSON-B also supports POJOs as claims with full marshaling/unmarshaling as necessary.
1274+
1275+
**NOTE**: `JSON-B` is just a specification and does not bring an implementation.
1276+
1277+
* In Java-SE environments you will need to add three more dependencies:
1278+
1. `jakarta.json:jakarta.json-api`
1279+
2. `jakarta.json.bind:jakarta.json.bind-api`
1280+
3. A JSON-B compliant implementation like [Eclipse Yasson](https://github.com/eclipse-ee4j/yasson) or [Apache Johnzon](https://johnzon.apache.org/johnzon-jsonb/index.html).
1281+
* In Java/Jakarta EE environments, you might need to enable the following features:
1282+
1. json-p / json-api
1283+
2. json-b / json-bind
1284+
12721285
**If you want to use POJOs as claim values, use either the `io.jsonwebtoken:jjwt-jackson` or
12731286
`io.jsonwebtoken:jjwt-gson` dependency** (or implement your own Serializer and Deserializer if desired). **But beware**,
12741287
Jackson will force a sizable (> 1 MB) dependency to an Android application thus increasing the app download size for
12751288
mobile users.
12761289
1290+
If you want to use POJOs and a JSON-B compliant specification _**or**_ you want to use JJWT on a JakartaEE compliant application server, use
1291+
`io.jsonwebtoken:jjwt-jsonb`.
1292+
12771293
<a name="json-custom"></a>
12781294
### Custom JSON Processor
12791295

0 commit comments

Comments
 (0)