Make `url` and `http_url` work with url.URL.
Fixes Or Enhances
This makes the url and http_url validations work with url.URL or any newtype that implements the Stringer interface. I'm not familiar with the codebase so it's kind of a PoC PR to see if you think this can be useful.
Make sure that you've checked the boxes below before you submit PR:
- [x] Tests exist or have been written that cover this particular change.
But they don't pass, if this is a feature we want and it's the right approach I can investigate deeper. I suspect the reflection magic isn't working as I expected.
@go-playground/validator-maintainers
I've added a few comments suggesting readability improvements.
I recommend keeping the original test functions unchanged and adding new ones for the Stringer type. Also, ensure the GitHub Actions checks pass.
coverage: 73.663% (-0.01%) from 73.677% when pulling e7c250a8cc726fd58285c73a16c9b3102e944e40 on bfabio:urls into bc77d03bfbd951ad1299267754e230b0af36a5aa on go-playground:master.
I rebased to include #1444 and tweaked it a bit.
@nodivbyzero @go-playground/validator-maintainers
@nodivbyzero wdyt?