feat: duration string parser #73
Reference in New Issue
Block a user
Delete Branch "string-duration"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
To implement this, the following alternatives have been considered:
We have opted to use pydantic because, as it is a mandatory dependency and is already integrated, there is no point in complicating things.
Hi @HideyoshiNakazone
It seems that with this change, the custom error is not thrown when an example is not valid for the given type, since pydantic.ValidationError is thrown first.
Should the error in StringTypeParser.from_properties_impl be ignored since it is subsequently checked in GenericTypeParser.from_properties?
Or how should we approach this case?
Codecov Report
✅ All modified and coverable lines are covered by tests.
📢 Thoughts on this report? Let us know!
The best approach is to catch any exception and convert it into a
ValidationError. Any error that occurs during schema parsing should be raised as aValidationError, allowing users of the library to easily distinguish schema-parsing issues from Pydantic validation errors throughout their code.All tests are now passing, are these all the proposed changes for this PR? If so, i thinks this PR is ready to merge.
Yeah! It was everything.
Thanks a lot for the contribution, @JCHacking. See you next time.