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