Saved Objects export API stable type order (#42310)

* Sorting export's valid types

* Updating the saved object api integration export test

* Fixing OSS also
This commit is contained in:
Brandon Kobel 2019-07-30 19:28:44 -07:00 committed by GitHub
parent 305e4a2ad1
commit f2f941fee3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View file

@ -58,13 +58,13 @@ export const createExportRoute = (
payload: Joi.object()
.keys({
type: Joi.array()
.items(Joi.string().valid(supportedTypes))
.items(Joi.string().valid(supportedTypes.sort()))
.single()
.optional(),
objects: Joi.array()
.items({
type: Joi.string()
.valid(supportedTypes)
.valid(supportedTypes.sort())
.required(),
id: Joi.string().required(),
})

View file

@ -139,7 +139,7 @@ export default function ({ getService }) {
statusCode: 400,
error: 'Bad Request',
message: 'child "type" fails because ["type" at position 0 fails because ' +
'["0" must be one of [config, index-pattern, visualization, search, dashboard, url]]]',
'["0" must be one of [config, dashboard, index-pattern, search, url, visualization]]]',
validation: {
source: 'payload',
keys: ['type.0'],

View file

@ -60,7 +60,7 @@ export function exportTestSuiteFactory(esArchiver: any, supertest: SuperTest<any
expect(resp.body).to.eql({
statusCode: 400,
error: 'Bad Request',
message: `child \"objects\" fails because [\"objects\" at position 0 fails because [child \"type\" fails because [\"type\" must be one of [config, globaltype, map, canvas-workpad, canvas-element, index-pattern, visualization, search, dashboard, url]]]]`,
message: `child \"objects\" fails because [\"objects\" at position 0 fails because [child \"type\" fails because [\"type\" must be one of [canvas-element, canvas-workpad, config, dashboard, globaltype, index-pattern, map, search, url, visualization]]]]`,
validation: {
source: 'payload',
keys: ['objects.0.type'],