Skip to content
This repository was archived by the owner on Oct 1, 2025. It is now read-only.
This repository was archived by the owner on Oct 1, 2025. It is now read-only.

Catering to malformed documents #123

Description

@yehjxraymond

Problem:

There is a test now that checks that the tests are skipped if the input is {}.

The problem is that in the test function, when we perform a getData, and TS shows the return type as WrappedDocument<v2.OpenAttestationDocument> not WrappedDocument<v2.OpenAttestationDocument> | undefined so it will be senseless to check for the malformed object in each and every of the verifier.

Here's some solutions, feel free to add more:

  1. Perform the check at OA level in the getData function to ensure that the returned object is of the right shape or throw.
  2. Perform the check BEFORE any verifications run to throw immediately instead of waiting for all the verifier to skip.
  3. Remove the test. If the user fucks it up, it's none of our business.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions