@toa.io/core 0.24.0-alpha.21 → 0.24.0-alpha.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/core",
|
|
3
|
-
"version": "0.24.0-alpha.
|
|
3
|
+
"version": "0.24.0-alpha.22",
|
|
4
4
|
"description": "Toa Core",
|
|
5
5
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/toa-io/toa#readme",
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@rsql/parser": "1.2.4",
|
|
24
|
-
"@toa.io/console": "0.24.0-alpha.
|
|
25
|
-
"@toa.io/generic": "0.24.0-alpha.
|
|
26
|
-
"@toa.io/yaml": "0.24.0-alpha.
|
|
24
|
+
"@toa.io/console": "0.24.0-alpha.22",
|
|
25
|
+
"@toa.io/generic": "0.24.0-alpha.22",
|
|
26
|
+
"@toa.io/yaml": "0.24.0-alpha.22",
|
|
27
27
|
"error-value": "0.3.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"clone-deep": "4.0.1"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "9680eca8da28019924a4c7cac5d803954d6c6936"
|
|
33
33
|
}
|
package/src/contract/request.js
CHANGED
|
@@ -29,11 +29,11 @@ class Request extends Conditions {
|
|
|
29
29
|
if (entity === undefined)
|
|
30
30
|
definition.query = false
|
|
31
31
|
|
|
32
|
-
if (definition.query === true)
|
|
32
|
+
if (definition.query === true)
|
|
33
|
+
required.push('query')
|
|
33
34
|
|
|
34
|
-
if (definition.query === false)
|
|
35
|
-
schema.
|
|
36
|
-
}
|
|
35
|
+
if (definition.query === false)
|
|
36
|
+
schema.properties.query = { type: 'null' }
|
|
37
37
|
|
|
38
38
|
if (definition.query !== false) {
|
|
39
39
|
const query = structuredClone(schemas.query)
|
|
@@ -57,7 +57,8 @@ class Request extends Conditions {
|
|
|
57
57
|
schema.properties.query = query
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
if (required.length > 0)
|
|
60
|
+
if (required.length > 0)
|
|
61
|
+
schema.required = required
|
|
61
62
|
|
|
62
63
|
return schema
|
|
63
64
|
}
|
|
@@ -58,8 +58,7 @@ describe('schema', () => {
|
|
|
58
58
|
})
|
|
59
59
|
|
|
60
60
|
it('should not contain query if declaration.query is false', () => {
|
|
61
|
-
|
|
62
|
-
schema.not = { required: ['query'] }
|
|
61
|
+
schema.properties.query = { type: 'null' }
|
|
63
62
|
expect(Request.schema({ query: false }, dummy)).toStrictEqual(schema)
|
|
64
63
|
})
|
|
65
64
|
|