MCPcopy Create free account
hub / github.com/axe-api/axe-api / getValidationRules

Method getValidationRules

packages/axe-api/src/Model.ts:376–392  ·  view source on GitHub ↗
(methodType: HttpMethods)

Source from the content-addressed store, hash-verified

374 }
375
376 getValidationRules(methodType: HttpMethods): ModelValidation | null {
377 if (this.hasStringValue()) {
378 return this.validations as ModelValidation;
379 }
380
381 const values: IMethodBaseConfig<ModelValidation> = this.validations;
382
383 switch (methodType) {
384 case HttpMethods.POST:
385 return values.POST ?? null;
386 case HttpMethods.PATCH:
387 case HttpMethods.PUT:
388 return values.PUT ?? null;
389 default:
390 return null;
391 }
392 }
393
394 getMiddlewares(handlerType: HandlerTypes): AxeFunction[] {
395 const results: AxeFunction[] = [];

Callers 4

pushMethod · 0.80
validateMethod · 0.80
validateMethod · 0.80
Model.spec.tsFile · 0.80

Calls 1

hasStringValueMethod · 0.95

Tested by

no test coverage detected