waibu-rest-api 2.6.0 → 2.6.1

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.
@@ -22,7 +22,8 @@ async function routeByModelBuilder ({ file, dir, pathPrefix, ns, parent }) {
22
22
  if (disabled) continue
23
23
  const mod = omit(builder, ['model', 'url', 'method', 'handler', 'hidden', ...methods])
24
24
  const customMod = builder[method] ?? {}
25
- if (!customMod.schema) customMod.schema = await this.docSchemaModel({ model: builder.model, method, options: { hidden: builder.hidden } })
25
+ customMod.schema = customMod.schema ?? false
26
+ if (customMod.schema === true) customMod.schema = await this.docSchemaModel({ model: builder.model, method, options: { hidden: builder.hidden } })
26
27
  let mapmethod = methodMap[method]
27
28
  if (this.config.enablePatch) {
28
29
  if (method === 'replace') mapmethod = 'PUT'
@@ -51,7 +52,7 @@ async function routeByModelBuilder ({ file, dir, pathPrefix, ns, parent }) {
51
52
  return me.transformResult({ data, req, reply, options })
52
53
  }
53
54
  })
54
- if (builder.schema === false) delete mod.schema
55
+ if (mod.schema === false) delete mod.schema
55
56
  mod.config = mod.config ?? {}
56
57
  mod.config.pathSrc = url
57
58
  mods.push(await serveRoute.call(me, { mod, ns, parent }))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-rest-api",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "REST API for Waibu",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-03-06
4
+
5
+ - [2.6.1] Bug fix on schema enforcement. Only apply when it's stated explicitely in route handler
6
+
3
7
  ## 2026-03-05
4
8
 
5
9
  - [2.6.0] Add transaction support by setting property ```transaction: true``` on model's route handler definition