Skip to content

Commit

Permalink
docs: clarify asMap behaviour in JwtClaims (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
efgpinto authored Jan 10, 2025
1 parent 7321a65 commit 6f14e04
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions akka-javasdk/src/main/java/akka/javasdk/JwtClaims.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ public interface JwtClaims {
/**
* Returns all the claims as a map of strings to strings.
*
* <p>If the claim is a String claim, the value will be the raw String. For all other types, it
* will be the value of the claim encoded to JSON.
* <p>Note that all values will be encoded to JSON. This means that if the value is a string, it
* will include the quotes. E.g. "\"my-string-claim\"" for a string claim.
*
* @return All the claims represented as a map of string claim names to string values.
* @return All the claims represented as a map of string claim names to string values containing a
* JSON representation of its value.
*/
Map<String, String> asMap();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ class JwtClaimsImpl(jwtClaims: RuntimeJwtClaims) extends JwtClaims {
/**
* Returns all the claims as a map of strings to strings.
*
* <p>If the claim is a String claim, the value will be the raw String. For all other types, it will be the value of
* the claim encoded to JSON.
* <p>Note that all values will be encoded to JSON. This means that if the value is a string, it will include the
* quotes. E.g. "\"my-string-claim\"" for a string claim.
*
* @return
* All the claims represented as a map of string claim names to string values.
* All the claims represented as a map of string claim names to string values containing a JSON representation of
* its value.
*/
override def asMap(): util.Map[String, String] =
jwtClaims.getAllClaimNames
Expand Down

0 comments on commit 6f14e04

Please sign in to comment.