FHIR Chat · Leading or trailing whitespace · smart/health-cards

Stream: smart/health-cards

Topic: Leading or trailing whitespace


view this post on Zulip Stephen Whitney (Sep 28 2021 at 14:47):

@Josh Mandel When I validate our SHC using the Microsoft SDK, I receive the error mentioned here: https://github.com/smart-on-fhir/health-cards-dev-tools/issues/145

Can you help me determine where I need to strip the whitespace? Is it before I deflate and base64 encode?

view this post on Zulip Stephen Whitney (Sep 28 2021 at 14:54):

Stephen Whitney said:

Josh Mandel When I validate our SHC using the Microsoft SDK, I receive the error mentioned here: https://github.com/smart-on-fhir/health-cards-dev-tools/issues/145

Can you help me determine where I need to strip the whitespace? Is it before I deflate and base64 encode?

Disregard, it looks like I got past the error.

view this post on Zulip Josh Mandel (Sep 28 2021 at 16:19):

Disregard, it looks like I got past the error.

Great! (Any quick lesson you can share here?)

view this post on Zulip Stephen Whitney (Sep 28 2021 at 18:17):

Josh Mandel said:

Disregard, it looks like I got past the error.

Great! (Any quick lesson you can share here?)

Surprisingly, once I handled the Warning for JWS.payload.vc.type: "VerifiableCredential" it went away:

JWS-compact

├─ Error
│ · JWS has leading or trailing spaces

└─ JWS.payload

├─ Warning
│ · JWS.payload.vc.type : 'VerifiableCredential' is not required and may be omitted to conserve space

└─ FhirBundle
Can't determine the latest dev tools version. Make sure you have the latest version.
Can't determine the latest spec version.

Validation completed

I also always had this python json.dumps with whitespace removal in place:

    base64url_payload = self._deflate_and_base64url_encode(
        json.dumps(payload, separators=(",", ":")).encode("utf-8")
    )

Last updated: Apr 12 2022 at 19:14 UTC