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

Add validation error and warning counts and other useful submission metadata #140

Closed
hkeeler opened this issue Apr 1, 2024 · 2 comments · Fixed by #165
Closed

Add validation error and warning counts and other useful submission metadata #140

hkeeler opened this issue Apr 1, 2024 · 2 comments · Fixed by #165
Assignees

Comments

@hkeeler
Copy link
Member

hkeeler commented Apr 1, 2024

Today we discussed how it would be useful to include the validation error and warning counts to the validation results so the frontend doesn't have to calculate it. If there are other bits of useful submission metadata we'd like to include, this could be a good time to do it.

@guffee23 guffee23 self-assigned this Apr 2, 2024
@guffee23
Copy link
Contributor

guffee23 commented Apr 3, 2024

Proposed change:

{
    "id": 1,
    "submitter": "631dbab3-4dcf-46bf-b283-55c18a3722e6",
    "state": "VALIDATION_WITH_ERRORS",
    "validation_ruleset_version": "v1",
    "validation_results": {
        "details": [
            {
                "validation": "json" #see https: //github.com/cfpb/sbl-filing-api/wiki/Validation-JSON
            }
        ],
        "metadata": {
            "warnings": 0,
            "errors": 0
        }
    },
    "filing": 1,
    "submission_time": "2024-04-01 12:12:12",
    "filename": "some-file.csv",
    "accepter": "631dbab3-4dcf-46bf-b283-55c18a3722e6"
}

@guffee23
Copy link
Contributor

guffee23 commented Apr 10, 2024

Updated proposed change for validation results:

validation_results: {
    syntax_errors: {
        count: <# of errors>
        details: <list of validation errors>
    }
 
    logical_errors: {
        count: <# of errors>
        details: <list of validation errors>
    }
 
    logical_warnings: {
        count: <# of warnings>
        details: <list of validation warnings>
    }
}

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 a pull request may close this issue.

2 participants