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

fix(validation)!: #266 validation.ValidationCommand no longer returns error if validation was run #267

Conversation

mike-winberry
Copy link
Collaborator

@mike-winberry mike-winberry commented Jun 18, 2024

Description

Reworked the ValidationCommand and v.Validate() return values to make it more clear when a non validation error has been thrown by changing the above methods to handle errors and validation errors separately using the ValidationResponse and ValidationResult types.

  • fix(validation)!: fix(validation): unclear distinction between "true" errors and "validationErrors" when using ValidationCommand #266 validation.ValidationCommand no longer returns an error when the validation has been successfully run (only returns error if it failed to initiate validation)
  • fix(validator)!: validator.Validate() no longer returns the parsed basic output as an error and instead returns the jsonschema.ValidationError
  • fix(cmd): validate cmd updated to handle ValidationCommand & validator.Validate changes
  • feat(validation): ValidationResponse gained the JsonSchemaError *jsonschema.ValidationError field

Related Issue

#266

Type of change

  • Bug fix (breaking)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Checklist before merging

… an error when the validation has been successfully run

fix(validator)!: validator.Validate() no longer returns the parsed basic output as an error and instead returns the jsonschema.ValidationError
fix(cmd): validate cmd updated to handle ValidationCommand & validator.Validate changes
…n-true-errors-and-validationerrors-when-using-validationcommand
@mike-winberry mike-winberry added bug Something isn't working chore Any refactor or uncategorized chore. labels Jun 18, 2024
@mike-winberry mike-winberry self-assigned this Jun 18, 2024
@mike-winberry mike-winberry added the question Further information is requested label Jun 18, 2024
…ssue opened to resolve the GetValidationResult returning an error
Copy link
Member

@brandtkeller brandtkeller left a comment

Choose a reason for hiding this comment

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

Resolves the identified issue. Currently prints both to stdout and the outputfile if specified - maybe that is intentional and otherwise doesn't block merge.

@mike-winberry
Copy link
Collaborator Author

Resolves the identified issue. Currently prints both to stdout and the outputfile if specified - maybe that is intentional and otherwise doesn't block merge.

intentional for now, not opposed to removing the log when the output file is set, I just always like my failures in the logs even if I am outputting.

@mike-winberry mike-winberry merged commit 3264df9 into main Jun 18, 2024
4 checks passed
@mike-winberry mike-winberry deleted the 266-fixvalidation-unclear-distinction-between-true-errors-and-validationerrors-when-using-validationcommand branch June 18, 2024 20:44
This was referenced Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chore Any refactor or uncategorized chore. question Further information is requested
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

fix(validation): unclear distinction between "true" errors and "validationErrors" when using ValidationCommand
2 participants