Skip to content

Commit

Permalink
remove joi usage from x-pack (#99401) (#100110)
Browse files Browse the repository at this point in the history
* remove unused helper

* remove joi usage from Security Solutions

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
mshustov and kibanamachine authored May 14, 2021
1 parent c2e37f9 commit defeb5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
23 changes: 0 additions & 23 deletions x-pack/plugins/apm/server/lib/helpers/input_validation.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

import Boom from '@hapi/boom';
import Joi from 'joi';
import { errors } from '@elastic/elasticsearch';
import { has, snakeCase } from 'lodash/fp';
import { SanitizedAlert } from '../../../../../alerting/common';
Expand Down Expand Up @@ -236,7 +235,12 @@ export const transformBulkError = (
}
};

export const buildRouteValidation = <T>(schema: Joi.Schema): RouteValidationFunction<T> => (
interface Schema {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
validate: (input: any) => { value: any; error?: Error };
}

export const buildRouteValidation = <T>(schema: Schema): RouteValidationFunction<T> => (
payload: T,
{ ok, badRequest }
) => {
Expand Down

0 comments on commit defeb5e

Please sign in to comment.