Skip to content

Commit

Permalink
Body with first-level schema keys in place
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Caldwell committed Jan 7, 2020
1 parent f7d50a2 commit 65f6c2a
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions x-pack/legacy/plugins/file_upload/server/routes/file_upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,7 @@ export function getImportRouteHandler(elasticsearchPlugin, getSavedObjectsReposi
}

export const importRouteConfig = {
// payload: {
// maxBytes: MAX_BYTES,
// },
validate: {
query: Joi.object().keys({
id: Joi.string(),
}),
body: Joi.object({
app: Joi.string(),
index: Joi.string()
Expand Down Expand Up @@ -91,9 +85,24 @@ export const initRoutes = (router, esPlugin, getSavedObjectsRepository) => {
router.post({
path: `${IMPORT_ROUTE}{id?}`,
validate: {
params: schema.maybe(schema.any()),
query: schema.object({}, { allowUnknowns: true }),
body: schema.object({}, { allowUnknowns: true }),
params: schema.maybe(schema.object({id: schema.string()})),
body: schema.object({
app: schema.maybe(schema.string()),
index: schema.string(),
data: schema.arrayOf(schema.object({}, { allowUnknowns: true })),
fileType: schema.string(),
ingestPipeline: schema.maybe(schema.object(
{},
{
defaultValue: {},
allowUnknowns: true
}
)),
settings: schema.maybe(schema.object({}, { allowUnknowns: true })),
mappings: schema.maybe(schema.object({}, { allowUnknowns: true })),
},
{ allowUnknowns: true }
),
},
options: {
body: {
Expand Down

0 comments on commit 65f6c2a

Please sign in to comment.