@omnifyjp/ts 2.1.9 → 2.1.10

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.
@@ -224,6 +224,13 @@ function mergeValidationRules(rules, vr, type) {
224
224
  const [a, b] = vr['digitsBetween'];
225
225
  rules.push(`digits_between:${a},${b}`);
226
226
  }
227
+ // Remove max:{length} when numeric rules are present — Laravel interprets
228
+ // max as numeric comparison instead of string length when numeric/digits present
229
+ if (vr['numeric'] === true || vr['digits'] != null || vr['digitsBetween'] != null) {
230
+ const maxIdx = rules.findIndex(r => typeof r === 'string' && r.startsWith('max:'));
231
+ if (maxIdx !== -1)
232
+ rules.splice(maxIdx, 1);
233
+ }
227
234
  if (vr['startsWith'] != null) {
228
235
  const v = vr['startsWith'];
229
236
  rules.push(`starts_with:${Array.isArray(v) ? v.join(',') : v}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnifyjp/ts",
3
- "version": "2.1.9",
3
+ "version": "2.1.10",
4
4
  "description": "TypeScript model type generator from Omnify schemas.json",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",