The Proof class defined in types.kt currently expects the JSON field "credential_type" when deserializing credentialType.
However, the actual response returned by the bridge uses the field name "verification_level" instead. This mismatch causes deserialization to fail and throw a "generic error," which prevents the user from completing the verification flow.
Steps to Reproduce:
- Integrate the SDK in a valid app with a valid staging app id.
- Initiate and complete the proof generation process via simulator.
- Observe that a "generic error" is returned instead of a successful proof result.
Expected Behavior:
The SDK should correctly map "verification_level" to the credentialType property in the Proof class to allow successful deserialization and verification.
Suggested Fix:
Update the @SerializedName annotation for credentialType to use "verification_level", or rename the property if that better reflects the bridge's current behavior.
@SerialName("verification_level") val credentialType: CredentialType
or
@SerialName("verification_level") val verificationLevel: VerificationLevel
Additional Context
for reference, the idkit-js handles this correctly:
[ISuccessResult](https://github.com/worldcoin/idkit-js/blob/main/packages/core/src/types/result.ts#L4-L9) uses "verification_level"
- the bridge logic includes a mapping to convert a returned
"credential_type" to a "verification_level" if needed.
Related
It’s possible the idkit-swift SDK has a similar issue, as it also appears to expect a credentialType field in its Proof equivalent. I haven’t confirmed this yet, but the structure looks similar enough that it may warrant a quick check for consistency.
Let me know if you'd like help submitting a pull request for this.
The
Proofclass defined in types.kt currently expects the JSON field "credential_type" when deserializing credentialType.However, the actual response returned by the bridge uses the field name "verification_level" instead. This mismatch causes deserialization to fail and throw a "generic error," which prevents the user from completing the verification flow.
Steps to Reproduce:
Expected Behavior:
The SDK should correctly map "verification_level" to the credentialType property in the Proof class to allow successful deserialization and verification.
Suggested Fix:
Update the
@SerializedNameannotation forcredentialTypeto use"verification_level", or rename the property if that better reflects the bridge's current behavior.or
Additional Context
for reference, the idkit-js handles this correctly:
[ISuccessResult](https://github.com/worldcoin/idkit-js/blob/main/packages/core/src/types/result.ts#L4-L9)uses"verification_level""credential_type"to a"verification_level"if needed.Related
It’s possible the idkit-swift SDK has a similar issue, as it also appears to expect a credentialType field in its Proof equivalent. I haven’t confirmed this yet, but the structure looks similar enough that it may warrant a quick check for consistency.
Let me know if you'd like help submitting a pull request for this.