{"id":18387665,"url":"https://github.com/thenetworg/azure-functions-model-validator","last_synced_at":"2025-10-11T22:43:22.952Z","repository":{"id":86362887,"uuid":"161330459","full_name":"TheNetworg/azure-functions-model-validator","owner":"TheNetworg","description":null,"archived":false,"fork":false,"pushed_at":"2018-12-13T22:34:09.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T00:28:49.040Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","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/TheNetworg.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-11T12:27:55.000Z","updated_at":"2018-12-13T22:34:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"563baad6-4168-48bf-b87a-3126a992532b","html_url":"https://github.com/TheNetworg/azure-functions-model-validator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheNetworg%2Fazure-functions-model-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheNetworg%2Fazure-functions-model-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheNetworg%2Fazure-functions-model-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheNetworg%2Fazure-functions-model-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheNetworg","download_url":"https://codeload.github.com/TheNetworg/azure-functions-model-validator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248508653,"owners_count":21115845,"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-11-06T01:27:17.022Z","updated_at":"2025-10-11T22:43:17.918Z","avatar_url":"https://github.com/TheNetworg.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Azure Functions model validator\nEasy to use fluent API for validating modesl that arrived via HttpTrigger. Define what should happen when the model is ok. Optionally you can define on-failiure callback. The validator is also in Async version.\n\n## Example\n\n```cs\npublic class Request\n    {\n        [Required]\n        public string Name { get; set; }\n    }\n    \n    //...\n\n\n[FunctionName(nameof(Sync))]\n        public static IActionResult Sync(\n            [HttpTrigger(AuthorizationLevel.Function, \"get\", \"post\", Route = null)]\n            Request req,\n            ILogger log)\n        {\n            return AzureFunctionFluentValidator\u003cRequest\u003e.Init\n                .OnSuccess(dto =\u003e new OkObjectResult($\"Hello {dto.Name}\"))\n                .OnFailure((dto, results) =\u003e\n                {\n                    results.ForEach(x =\u003e log.LogWarning(x.ErrorMessage));\n                })\n                .ValidateAndReturn(req);\n        }\n        \n          [FunctionName(nameof(Async))]\n        public static Task\u003cIActionResult\u003e Async(\n            [HttpTrigger(AuthorizationLevel.Function, \"get\", \"post\", Route = null)]\n            Request req,\n            ILogger log)\n        {\n            return AzureFunctionFluentAsyncValidator\u003cRequest\u003e.Init\n                .OnSuccess(async dto =\u003e\n                {\n                    log.LogInformation($\"Waiting for one second\");\n                    await Task.Delay(1000);\n                    return new OkObjectResult($\"Hello {dto.Name}\");\n                })\n                .OnFailure(async (dto, results) =\u003e\n                {\n                    log.LogInformation($\"Waiting for one second\");\n                    await Task.Delay(1000);\n                    results.ForEach(x =\u003e log.LogWarning(x.ErrorMessage));\n                })\n                .ValidateAndReturnAsync(req);\n        }\n        \n        \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthenetworg%2Fazure-functions-model-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthenetworg%2Fazure-functions-model-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthenetworg%2Fazure-functions-model-validator/lists"}