Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

92770: Add JSON schema validation for Form 21a submissions #19510

Merged

Conversation

ojbucao
Copy link
Contributor

@ojbucao ojbucao commented Nov 19, 2024

Add SchemaValidationError class to handle validation failures
Add schema validation to form submission pipeline
Use VetsJsonSchema to validate form structure
Add error logging for schema validation failures
Add request specs for schema validation failures
The validation now ensures Form 21a submissions match the expected schema structure before being processed.

OJ Bucao and others added 8 commits November 5, 2024 15:17
- Add SchemaValidationError class to handle validation failures
- Add schema validation to form submission pipeline
- Use VetsJsonSchema to validate form structure
- Add error logging for schema validation failures
- Add request specs for schema validation failures

The validation now ensures Form 21a submissions match the expected schema
structure before being processed.
- Fix rubocop errors regarding spaces and strings literal formats
- Replace forward slash delimiters with %r{} for better readability
- Format multi-line regex pattern to improve maintainability
- Avoid escaping forward slashes in error message pattern
- Retain original matching functionality for Form21a JSON validation error
- Revert multiline formatting to maintain exact pattern match
- Fix failing specs for Form21a JSON validation errors
- Keep %r syntax improvement but remove heredoc style
@ojbucao ojbucao requested review from a team as code owners November 19, 2024 16:33
@ojbucao
Copy link
Contributor Author

ojbucao commented Nov 19, 2024

I had to delete the old one because the linting part kept trying to use the unmodified code and wouldn't pass. So I'm recreating this PR.

@ojbucao ojbucao requested a review from nihil2501 November 19, 2024 16:36
Copy link
Contributor

@nihil2501 nihil2501 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@RachalCassity RachalCassity self-assigned this Nov 20, 2024
Copy link

Backend-review-group approval confirmed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants