Fixing some errors in the generated spec.
This commit is contained in:
parent
01bb56cbf4
commit
4b3da534e3
|
@ -941,21 +941,18 @@
|
|||
},
|
||||
"query": {
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"required": []
|
||||
"properties": {}
|
||||
},
|
||||
"user": {
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"required": []
|
||||
"properties": {}
|
||||
},
|
||||
"userOutput": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"user": {
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"required": []
|
||||
"properties": {}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
|
|
@ -690,18 +690,15 @@ components:
|
|||
query:
|
||||
type: object
|
||||
properties: {}
|
||||
required: []
|
||||
user:
|
||||
type: object
|
||||
properties: {}
|
||||
required: []
|
||||
userOutput:
|
||||
type: object
|
||||
properties:
|
||||
user:
|
||||
type: object
|
||||
properties: {}
|
||||
required: []
|
||||
required:
|
||||
- user
|
||||
nameSearch:
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
exports.object = (props, opts) => {
|
||||
return {
|
||||
const base = {
|
||||
type: "object",
|
||||
properties: props,
|
||||
required: Object.keys(props),
|
||||
...opts,
|
||||
}
|
||||
if (Object.keys(props).length > 0 && (!opts || !opts.required)) {
|
||||
base.required = Object.keys(props)
|
||||
}
|
||||
return base
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue