{"id":13431200,"url":"https://github.com/FluentValidation/FluentValidation","last_synced_at":"2025-03-16T11:31:13.045Z","repository":{"id":36997693,"uuid":"443962","full_name":"FluentValidation/FluentValidation","owner":"FluentValidation","description":"A popular .NET validation library for building strongly-typed validation rules.","archived":false,"fork":false,"pushed_at":"2024-10-15T20:09:09.000Z","size":20221,"stargazers_count":9090,"open_issues_count":3,"forks_count":1199,"subscribers_count":271,"default_branch":"main","last_synced_at":"2024-10-29T11:29:07.702Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://fluentvalidation.net","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FluentValidation.png","metadata":{"files":{"readme":".github/README.md","changelog":"Changelog.txt","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"License.txt","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["JeremySkinner"],"open_collective":"FluentValidation"}},"created_at":"2009-12-20T19:17:03.000Z","updated_at":"2024-10-28T10:36:15.000Z","dependencies_parsed_at":"2023-02-16T08:10:17.137Z","dependency_job_id":"08e1ac62-23c3-4623-b2f1-6e850d4ec5a0","html_url":"https://github.com/FluentValidation/FluentValidation","commit_stats":{"total_commits":2261,"total_committers":286,"mean_commits":7.905594405594406,"dds":0.2198142414860681,"last_synced_commit":"f534dca8bee4223dbc8f30e2a1870b59a390177c"},"previous_names":["jeremyskinner/fluentvalidation"],"tags_count":141,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluentValidation%2FFluentValidation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluentValidation%2FFluentValidation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluentValidation%2FFluentValidation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluentValidation%2FFluentValidation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FluentValidation","download_url":"https://codeload.github.com/FluentValidation/FluentValidation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243673114,"owners_count":20328886,"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","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":[],"created_at":"2024-07-31T02:01:01.284Z","updated_at":"2025-03-16T11:31:13.033Z","avatar_url":"https://github.com/FluentValidation.png","language":"C#","readme":"\u003cp\u003e\r\n\u003cimg src=\"https://raw.githubusercontent.com/FluentValidation/FluentValidation/gh-pages/assets/images/logo/fluent-validation-logo.png\" alt=\"FluentValidation\" width=\"250px\" /\u003e\r\n\u003c/p\u003e\r\n\r\n[![Build Status](https://github.com/FluentValidation/FluentValidation/workflows/CI/badge.svg)](https://github.com/FluentValidation/FluentValidation/actions?query=workflow%3ACI) [![NuGet](https://img.shields.io/nuget/v/FluentValidation.svg)](https://nuget.org/packages/FluentValidation) [![Nuget](https://img.shields.io/nuget/dt/FluentValidation.svg)](https://nuget.org/packages/FluentValidation)\r\n\r\n[Full Documentation](https://fluentvalidation.net)\r\n\r\nA validation library for .NET that uses a fluent interface\r\nand lambda expressions for building strongly-typed validation rules.\r\n\r\n---\r\n### Supporting the project\r\nIf you use FluentValidation in a commercial project, please sponsor the project financially. FluentValidation is developed and supported by [@JeremySkinner](https://github.com/JeremySkinner) for free in his spare time and financial sponsorship helps keep the project going. You can sponsor the project via either [GitHub sponsors](https://github.com/sponsors/JeremySkinner) or [OpenCollective](https://opencollective.com/FluentValidation).\r\n\r\n---\r\n\r\n### Get Started\r\n\r\nFluentValidation can be installed using the Nuget package manager or the `dotnet` CLI.\r\n\r\n```\r\ndotnet add package FluentValidation\r\n```\r\n\r\n[Review our documentation](https://docs.fluentvalidation.net) for instructions on how to use the package.\r\n\r\n---\r\n\r\n### Example\r\n```csharp\r\nusing FluentValidation;\r\n\r\npublic class CustomerValidator: AbstractValidator\u003cCustomer\u003e {\r\n  public CustomerValidator() {\r\n    RuleFor(x =\u003e x.Surname).NotEmpty();\r\n    RuleFor(x =\u003e x.Forename).NotEmpty().WithMessage(\"Please specify a first name\");\r\n    RuleFor(x =\u003e x.Discount).NotEqual(0).When(x =\u003e x.HasDiscount);\r\n    RuleFor(x =\u003e x.Address).Length(20, 250);\r\n    RuleFor(x =\u003e x.Postcode).Must(BeAValidPostcode).WithMessage(\"Please specify a valid postcode\");\r\n  }\r\n\r\n  private bool BeAValidPostcode(string postcode) {\r\n    // custom postcode validating logic goes here\r\n  }\r\n}\r\n\r\nvar customer = new Customer();\r\nvar validator = new CustomerValidator();\r\n\r\n// Execute the validator\r\nValidationResult results = validator.Validate(customer);\r\n\r\n// Inspect any validation failures.\r\nbool success = results.IsValid;\r\nList\u003cValidationFailure\u003e failures = results.Errors;\r\n```\r\n\r\n### License, Copyright etc\r\n\r\nFluentValidation has adopted the [Code of Conduct](https://github.com/FluentValidation/FluentValidation/blob/main/.github/CODE_OF_CONDUCT.md) defined by the Contributor Covenant to clarify expected behavior in our community.\r\nFor more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).\r\n\r\nFluentValidation is copyright \u0026copy; 2008-2022 .NET Foundation, [Jeremy Skinner](https://jeremyskinner.co.uk) and other contributors and is licensed under the [Apache2 license](https://github.com/JeremySkinner/FluentValidation/blob/master/License.txt).\r\n\r\n### Sponsors\r\n\r\nThis project is sponsored by the following organisations whose support help keep this project going:\r\n\r\n- [Microsoft](https://microsoft.com) for their financial contribution \r\n- [JetBrains](https://www.jetbrains.com/?from=FluentValidation) for providing licenses to their developer tools\r\n\r\nThis project is part of the [.NET Foundation](https://dotnetfoundation.org).\r\n","funding_links":["https://github.com/sponsors/JeremySkinner","https://opencollective.com/FluentValidation"],"categories":["Frameworks, Libraries and Tools","C\\#","C# #","C#","Validation","Libraries","General","Misc","杂项","🗒️ Cheatsheets","Audio"],"sub_categories":["Misc","Validation","GUI - other","📦 Libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFluentValidation%2FFluentValidation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFluentValidation%2FFluentValidation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFluentValidation%2FFluentValidation/lists"}