Skip to content

Add JSON Schema for VA Form 22-1990n#1

Draft
voidspooks wants to merge 1 commit into
masterfrom
optimus/22-1990n-schema-20260426T212045Z-e864
Draft

Add JSON Schema for VA Form 22-1990n#1
voidspooks wants to merge 1 commit into
masterfrom
optimus/22-1990n-schema-20260426T212045Z-e864

Conversation

@voidspooks

Copy link
Copy Markdown
Owner

⚠️ AI-Generated PR — This pull request was automatically generated by Optimus. All code requires human review and testing before merging.

New schema — VA Form 22-1990n

Summary

This PR introduces a new JSON Schema (Draft-04) for VA Form 22-1990n — the Application for VA Education Benefits Under the National Call to Service (NCS) Program. The schema is defined in src/schemas/22-1990n/schema.js and covers the core data structures needed to validate form submissions.

Key highlights of the schema include:

  • Shared definitions for common field types reused across properties:
    • ssn — 9-digit Social Security Number (no hyphens), enforced via regex pattern and min/maxLength
    • date — ISO 8601 format (YYYY-MM-DD), validated with both format: date and a regex pattern
    • phone — 10-digit US phone number (digits only), enforced via regex pattern and min/maxLength
    • postalCode — US ZIP code (5-digit format), with pattern validation
  • additionalProperties: false is set at the root level to enforce strict property boundaries and prevent unexpected fields from passing validation
  • Definitions are referenced throughout the schema using a buildDefinitionReference helper that generates $ref pointers to #/definitions/<referenceId>, keeping the schema DRY and consistent

Files

  • src/schemas/22-1990n/schema.js

Notes for reviewer

  • Please ensure you have incremented the version in package.json
  • Please add backend-review-group as a reviewer
  • The ssn definition deliberately strips hyphens — consuming applications should ensure any formatted input (e.g., 123-45-6789) is normalized before submission
  • The date definition applies both format: date and a regex pattern for defense-in-depth validation; confirm this is consistent with how other schemas in this repo handle date fields
  • The phone definition accepts digits only with no formatting characters — frontend validation should handle stripping before submission
  • Verify that all required top-level properties are explicitly listed in a required array, as this was not visible in the provided artifact excerpt
  • Confirm that the postalCode pattern handles ZIP+4 format (XXXXX-XXXX) if needed by this form, or intentionally restricts to 5-digit only

Pull Requests to update the schema in related repositories

  • vets-api: pending
  • vets-website: pending

Generated by Optimus (https://github.com/aquia-inc/optimus).
All files require human review before merging.

Files:
- src/schemas/22-1990n/schema.js
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