waibu-rest-api 1.1.4 → 1.1.6

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.
@@ -20,6 +20,7 @@ async function routeByVerb ({ file, ctx, appCtx, dir, pathPrefix, ns, alias, par
20
20
  else mod = { handler: mod }
21
21
  }
22
22
  mod.url = mod.url ?? url
23
+ if (isFunction(mod.url)) mod.url = await mod.url.call(this)
23
24
  mod.method = method
24
25
  const defSchema = {
25
26
  description: this.docSchemaDescription(action),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-rest-api",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "REST API for Waibu",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17,6 +17,9 @@ async function buildPropsReqs ({ schema, method, options = {} }) {
17
17
  for (const p of schema.properties) {
18
18
  if (hidden.includes(p.name)) continue
19
19
  properties[p.name] = { type: getType(p.type) }
20
+ if (properties[p.name].type === 'object') {
21
+ properties[p.name].additionalProperties = true
22
+ }
20
23
  if (!p.required) properties[p.name].nullable = true
21
24
  else if (method === 'create' && p.name !== 'id') required.push(p.name)
22
25
  if (['datetime'].includes(p.type)) properties[p.name].format = 'date-time'