aspnet-fastendpoints.request.mustache Maven / Gradle / Ivy
{{#useValidators}}using FluentValidation;{{/useValidators}}
using {{packageName}}.Models;
namespace {{packageName}}.{{apiPackage}};
{{#useRecords}}{{>requestRecord}}{{/useRecords}}
{{^useRecords}}{{>requestClass}}{{/useRecords}}
{{#useValidators}}
{{#operations}}{{#operation}}
public class {{operationId}}RequestValidator : FastEndpoints.Validator<{{operationId}}Request>
{
public {{operationId}}RequestValidator()
{
{{#requiredParams}}
RuleFor(x => x.{{#isBodyParam}}{{paramName}}{{/isBodyParam}}{{^isBodyParam}}{{nameInPascalCase}}{{/isBodyParam}}).NotEmpty();
{{/requiredParams}}
}
}
{{/operation}}{{/operations}}
{{/useValidators}}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy