Skip to content

feat: validate credential fields on POST /credentials/issue#2

Open
djscruggs wants to merge 2 commits into
mainfrom
credential-issue-validation
Open

feat: validate credential fields on POST /credentials/issue#2
djscruggs wants to merge 2 commits into
mainfrom
credential-issue-validation

Conversation

@djscruggs
Copy link
Copy Markdown
Collaborator

What

  • Add validateCredentialFields to POST /credentials/issue that checks @context, type, issuer, and credentialSubject
  • Returns 400 invalid-input for missing or malformed required fields
  • Add 12 new integration tests covering all conformance cases, including an expirationDate pass-through check

Why

The vc-api-issuer-test-suite exercises POST /credentials/issue with malformed credentials and expects 400 responses. Without this validation the mock returned 201 for all of those cases, making it an unreliable test double for code that depends on correct error behavior.

Testing

  • npm test — all 90 tests pass
  • npx tsc --noEmit — no type errors

Reference

🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

djscruggs and others added 2 commits May 20, 2026 08:07
Adds field-level validation for @context, type, issuer, and
credentialSubject so the mock returns 400 on malformed input,
matching the behavior required by the vc-api-issuer-test-suite.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Expand single-line arrow function bodies and split long cast line
to satisfy @stylistic/brace-style and @stylistic/max-len rules.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@djscruggs djscruggs requested a review from BigBlueHat May 20, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant