Skip to content

Commit

Permalink
OY-4717 oppijanumerorekisterin kenttien parsinta fiksattu
Browse files Browse the repository at this point in the history
  • Loading branch information
marjakari committed Dec 31, 2024
1 parent e8e040c commit 11f2a1c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ trait OppijanumerorekisteriComponent {
val result = future.map {
case r if r.getStatusCode == 200 =>
logger.info(s"oppijanumerorekisteri response ${r.getResponseBody}")
parse(r.getResponseBodyAsStream()).extract[Henkilo]
// parsitaan relevantit kentät
val parsedJson = parse(r.getResponseBodyAsStream())
val oid = (parsedJson \ "oidHenkilo").extract[String]
val hetu = (parsedJson \ "hetu").extractOpt[String]
val oppijanumero = (parsedJson \ "oppijanumero").extractOpt[String]
Henkilo(oid, hetu, oppijanumero)
case r =>
throw new RuntimeException(new RuntimeException(s"Failed to get henkilö for $personOid: ${r.toString()}"))
}
Expand Down

0 comments on commit 11f2a1c

Please sign in to comment.