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

refactor(*): add iso8601duration validate tag #78

Merged
merged 1 commit into from
Sep 26, 2022
Merged

refactor(*): add iso8601duration validate tag #78

merged 1 commit into from
Sep 26, 2022

Conversation

lsytj0413
Copy link
Collaborator

Signed-off-by: lsytj0413 511121939@qq.com

Many thanks for submitting your Pull Request ❤️!

What this PR does / why we need it:

  • simplify iso 8601 duration string validate

Special notes for reviewers:

Additional information (if needed):

@lsytj0413
Copy link
Collaborator Author

The #76 should be merge before, it will fix WhiteSource Security Check

@ricardozanini ricardozanini removed the request for review from tsurdilo September 23, 2022 11:49
Copy link
Member

@ricardozanini ricardozanini left a comment

Choose a reason for hiding this comment

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

NIce!

Can you rebase to clear the error in the white sec bot?

@@ -94,7 +101,7 @@ func TestRetryStructLevelValidation(t *testing.T) {
Increment: "PT5S",
Jitter: floatstr.FromString("P5S"),
},
err: `Key: 'Retry.Jitter' Error:Field validation for 'Jitter' failed on the 'reqiso8601duration' tag`,
err: `Key: 'Retry.Jitter' Error:Field validation for 'Jitter' failed on the 'iso8601duration' tag`,
Copy link
Member

Choose a reason for hiding this comment

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

this message is coming from the validateFunc, right?
Do you think we can make this message easier to understand?

Something like "field is not iso8601duration"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, we should custom the error message to have more description, and this should be done later. For how to implement custom error message, maybe go-playground/validator#559 will helpful.

Signed-off-by: lsytj0413 <511121939@qq.com>
@lsytj0413
Copy link
Collaborator Author

@ricardozanini
done, PTAL

Copy link
Member

@ricardozanini ricardozanini left a comment

Choose a reason for hiding this comment

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

Pretty cool!

@ricardozanini ricardozanini added this to the Spec 0.8 Support milestone Sep 26, 2022
@ricardozanini ricardozanini merged commit 1293519 into serverlessworkflow:main Sep 26, 2022
@lsytj0413 lsytj0413 deleted the validate-iso8601-duration-tag branch September 26, 2022 13:53
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.

None yet

3 participants