@laboratoria/sdk-js 4.0.0-alpha.3 → 4.0.0-beta.0
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/lib/model.js
CHANGED
|
@@ -14,7 +14,7 @@ const createValidator = (schema) => {
|
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
return { id: '
|
|
17
|
+
return { id: 'value-missing-validation-error' };
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
if (propSchema.enum) {
|
|
@@ -48,7 +48,7 @@ const createValidator = (schema) => {
|
|
|
48
48
|
case 'string':
|
|
49
49
|
default:
|
|
50
50
|
if (propSchema.isRequired && !value) {
|
|
51
|
-
return { id: '
|
|
51
|
+
return { id: 'value-missing-validation-error' };
|
|
52
52
|
}
|
|
53
53
|
break;
|
|
54
54
|
}
|
|
@@ -242,20 +242,17 @@ export const createModel = (
|
|
|
242
242
|
const relations = Object.keys(properties || {}).reduce(
|
|
243
243
|
(memo, key) => (
|
|
244
244
|
properties[key].isRef && properties[key].isScalar && properties[key].isRequired
|
|
245
|
-
// isRequiredOneToOneRelation(parsedSchema, key)
|
|
246
245
|
? Object.assign(memo, {
|
|
247
246
|
all: memo.all.concat(key),
|
|
248
247
|
oneToOne: memo.oneToOne.concat(key),
|
|
249
248
|
requiredOneToOne: memo.requiredOneToOne.concat(key),
|
|
250
249
|
})
|
|
251
|
-
// : isOptionalOneToOneRelation(parsedSchema, key)
|
|
252
250
|
: properties[key].isRef && properties[key].isScalar
|
|
253
251
|
? Object.assign(memo, {
|
|
254
252
|
all: memo.all.concat(key),
|
|
255
253
|
oneToOne: memo.oneToOne.concat(key),
|
|
256
254
|
optionalOneToOne: memo.optionalOneToOne.concat(key),
|
|
257
255
|
})
|
|
258
|
-
// : isOneToManyRelation(parsedSchema, key)
|
|
259
256
|
: properties[key].isRef
|
|
260
257
|
? Object.assign(memo, {
|
|
261
258
|
all: memo.all.concat(key),
|
package/package.json
CHANGED