Expected Behavior
Urls like "http://localhost:8000" or ""http://foo.com:8080" pass isWebsite() validator.
Actual Behavior
Any URL with a port or without a domain suffix will fail the regex matching.
Steps to Reproduce the Problem
- Create a string validator which uses isWebsite (eg:
validate(MyCommand::myUrl).isNotEmpty().isWebsite()
- Pass it a value with a port or an internal domain name,
Example Code or Link to a Project
data class MyCommand(
val url1: String,
val url2: String,
) : BaseCommand() {
init {
validate(this) {
validate(MyCommand::url1).isNotEmpty().isWebsite()
validate(MyCommand::url2).isNotEmpty().isWebsite()
}
}
}
Json Payload
{
"url1": "http://localhost/",
"url2": "http://mydomain.com:8000"
}
Environment
- Valiktor version: 0.12.0
- JDK/JRE version: 17
- Platform/OS: Windows
Expected Behavior
Urls like "http://localhost:8000" or ""http://foo.com:8080" pass isWebsite() validator.
Actual Behavior
Any URL with a port or without a domain suffix will fail the regex matching.
Steps to Reproduce the Problem
validate(MyCommand::myUrl).isNotEmpty().isWebsite()Example Code or Link to a Project
Json Payload
Environment