What problem does it solve?
Grants.gov form development spans multiple repos and requires strict consistency across API schemas, UI rendering, and business rules. This rule set ensures a standardized, validated approach to building and maintaining grant application forms, reducing drift and errors during updates.
Core Features & Use Cases
- Enforces three-schema form definitions (FORM_JSON_SCHEMA, FORM_UI_SCHEMA, FORM_RULE_SCHEMA) co-located with a static Form instance registered in get_active_forms(), ensuring consistent validation, rendering, and business rules across code paths.
- Uses a custom JSON schema validator to extend Draft2020-12, with strict required-field checks and proactive validation to catch schema issues before deployment.
- Fail loudly on invalid schemas by validating schema structure prior to use and surfacing errors as logs or exceptions to prevent silent failures.
- Provides declarative XML transform rules with required _metadata namespaces, preserving compatibility with Grants.gov XML outputs and enabling deterministic transformation.
- Maintains legacy XML fidelity by verifying the order and presence of legacy XML elements to match XSD expectations.
- Supports non-blocking validation by returning validation issues as warnings during PUT/save operations, allowing progressive refinement without blocking user actions.
- Encourages end-to-end testing practices with a Page Object Model for E2E form tests and a triad of minimal/full/empty JSON validations.
- Includes guidance for context enrichment and cross-rule references to ensure consistency with broader forms architecture rules.
Quick Start
Edit grant form schemas by defining three co-located schemas and a static Form instance, then validate with the custom validator before deployment.