{"id":17686386,"url":"https://github.com/shihyuho/jsr303-validator","last_synced_at":"2025-08-24T14:34:10.950Z","repository":{"id":57722752,"uuid":"104621423","full_name":"shihyuho/jsr303-validator","owner":"shihyuho","description":"A collection of validators for java bean validation","archived":false,"fork":false,"pushed_at":"2017-09-24T14:27:47.000Z","size":44,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T20:46:54.588Z","etag":null,"topics":["bean","java","jexl","jsr303","spring-expression-language","validation"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shihyuho.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-24T05:33:09.000Z","updated_at":"2022-06-17T02:40:17.000Z","dependencies_parsed_at":"2022-08-28T08:40:50.468Z","dependency_job_id":null,"html_url":"https://github.com/shihyuho/jsr303-validator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/shihyuho/jsr303-validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shihyuho%2Fjsr303-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shihyuho%2Fjsr303-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shihyuho%2Fjsr303-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shihyuho%2Fjsr303-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shihyuho","download_url":"https://codeload.github.com/shihyuho/jsr303-validator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shihyuho%2Fjsr303-validator/sbom","scorecard":{"id":818477,"data":{"date":"2025-08-11","repo":{"name":"github.com/shihyuho/jsr303-validator","commit":"707272bb358cfb00a89ac36780a937df8d369e92"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.2,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/15 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/shihyuho/.github/SECURITY.md:1","Info: Found linked content: github.com/shihyuho/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/shihyuho/.github/SECURITY.md:1","Info: Found text in security policy: github.com/shihyuho/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":0,"reason":"15 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-36p3-wjmg-h94x","Warn: Project is vulnerable to: GHSA-hh26-6xwr-ggv7","Warn: Project is vulnerable to: GHSA-4gc7-5j7h-4qph","Warn: Project is vulnerable to: GHSA-4wp7-92pw-q264","Warn: Project is vulnerable to: GHSA-g5mm-vmx4-3rg7","Warn: Project is vulnerable to: GHSA-4487-x383-qpph","Warn: Project is vulnerable to: GHSA-f26x-pr96-vw86","Warn: Project is vulnerable to: GHSA-ffvq-7w96-97p7","Warn: Project is vulnerable to: GHSA-g8hw-794c-4j9g","Warn: Project is vulnerable to: GHSA-rcpf-vj53-7h2m","Warn: Project is vulnerable to: GHSA-v596-fwhq-8x48","Warn: Project is vulnerable to: GHSA-558x-2xjg-6232","Warn: Project is vulnerable to: GHSA-564r-hj7v-mcr5","Warn: Project is vulnerable to: GHSA-9cmq-m9j5-mvww","Warn: Project is vulnerable to: GHSA-wxqc-pxw9-g2p8"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T14:46:25.570Z","repository_id":57722752,"created_at":"2025-08-23T14:46:25.570Z","updated_at":"2025-08-23T14:46:25.570Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271887733,"owners_count":24839137,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-24T02:00:11.135Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bean","java","jexl","jsr303","spring-expression-language","validation"],"created_at":"2024-10-24T10:44:45.441Z","updated_at":"2025-08-24T14:34:10.880Z","avatar_url":"https://github.com/shihyuho.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSR303 Validators\n\nA collection of jsr-303 validators I used\n\n[![Build Status](https://travis-ci.org/shihyuho/jsr303-validator.svg?branch=master)](https://travis-ci.org/shihyuho/jsr303-validator)\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.shihyuho\u003c/groupId\u003e\n  \u003cartifactId\u003ejsr303-validator\u003c/artifactId\u003e\n  \u003cversion\u003e1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## AssertThat\n\nIntegration with [Apache commons JEXL](http://commons.apache.org/proper/commons-jexl/)\n\n```java\n@AssertThat(\n\tvalue = \"this.age \u003e= 18 || (this.age \u003c 18  \u0026\u0026 not empty(this.parent))\",\n    propertyNode = \"age\")\n@Data\npublic class MyBean {\n\tprivate int age;\n\tprivate String parent;\n\t@AssertThat(\"this != null \u0026\u0026 this.isAfter(forName('java.time.LocalDate').now().plusDays(7))\")\n\tprivate LocalDate expire;\n\t// ...\n}\n```\n\n\n- `this` - Represent the Object where *@AssertThat* located.\n\n```java\n@AssertThat(\"this != null\") // 'this' referring to expire field\nprivate LocalDate expire;\n```\n\n```java\n@AssertThat(\"this != null\") // 'this' referring to SomeObject\npublic class SomeObject {\n}\n```\n\n- `namespace` - Indicate the namespace referring to a class.\n\n```java\n@AssertThat(\n\tvalue = \"math:abs(this) \u003e 10\",\n\tnamespaces = {\n\t\t@Namespace(prefix = \"math\", clazz = Math.class)\n\t}\n)\nprivate int index;\n```\n \n- `propertyNode` - Indecate a property node the *ConstraintViolation* will be associated to.\n\n```java\n@AssertThat(\n\tvalue = \"this.age \u003e= 18 || (this.age \u003c 18  \u0026\u0026 not empty(this.parent))\",\n\tpropertyNode = \"age\")\npublic class MyBean {\n\tprivate int age;\n\tprivate String parent;\n}\n```\n\n```java\nConstraintViolationImpl {\n\tinterpolatedMessage=\"com.github.shihyuho.jsr303.constraints.AssertThat.message\", \n\tpropertyPath=\"age\",\n\trootBeanClass=...,\n\tmessageTemplate='com.github.shihyuho.jsr303.constraints.AssertThat.message'\n}\n```\n\nSupports [Spring Expression Language](https://docs.spring.io/spring/docs/current/spring-framework-reference/html/expressions.html) as well\n\n```java\n@AssertThat(\n\tengine = AssertThat.Engine.SpEL, // JEXL is the defualt EL engine\n\tvalue =\n\t    \"#{this.age \u003e= 18 || (this.age \u003c 18  \u0026\u0026 !T(org.springframework.util.StringUtils).isEmpty(this.parent))}\",\n\tpropertyNode = \"age\"\n)\npublic class MyBean {\n    private int age;\n    private String parent;\n}\n```\n\n### Custom Annotation\n\n```java\npublic enum Grade {\n  A, B, C, D, E, F, ;\n}\n```\n\n```java\n@Documented\n@Constraint(validatedBy = {})\n@Target({ElementType.FIELD})\n@Retention(RetentionPolicy.RUNTIME)\n@AssertThat(\n  \"this != null \u0026\u0026 \" +\n  \"forName('java.util.Arrays').asList(\" +\n    \"forName('com.github.shihyuho.jsr303.constraints.Grade').valueOf('A'), \" +\n    \"forName('com.github.shihyuho.jsr303.constraints.Grade').valueOf('B')\" +\n  \").contains(this)\")\npublic @interface GradeAboveB {\n\tString message() default \"{com.github.shihyuho.jsr303.constraints.GradeAboveB.message}\";\n\tClass\u003c?\u003e[] groups() default {};\n\tClass\u003c? extends Payload\u003e[] payload() default {};\n}\n```\n\n```java\n@Data\npublic class PassExams {\n\tprivate Student student;\n\tprivate Exam exam;\n\t@GradeAboveB private Grade grade;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshihyuho%2Fjsr303-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshihyuho%2Fjsr303-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshihyuho%2Fjsr303-validator/lists"}