fix(xo-server/api): keep previous params format
Introduced by d7f29e736
Avoid breaking `xo-cli --list-commands`.
This commit is contained in:
parent
d7f29e7363
commit
6598090662
@ -2,6 +2,7 @@ import emitAsync from '@xen-orchestra/emit-async'
|
||||
import { createLogger } from '@xen-orchestra/log'
|
||||
|
||||
import Ajv from 'ajv'
|
||||
import cloneDeep from 'lodash/cloneDeep.js'
|
||||
import forEach from 'lodash/forEach.js'
|
||||
import kindOf from 'kindof'
|
||||
import ms from 'ms'
|
||||
@ -253,7 +254,7 @@ export default class Api {
|
||||
|
||||
const { params } = method
|
||||
if (params !== undefined) {
|
||||
let schema = { type: 'object', properties: params }
|
||||
let schema = { type: 'object', properties: cloneDeep(params) }
|
||||
try {
|
||||
schema = adaptJsonSchema(schema)
|
||||
method.validate = ajv.compile(schema)
|
||||
|
Loading…
Reference in New Issue
Block a user