mirror of
https://github.com/strapi/strapi.git
synced 2025-12-25 06:04:29 +00:00
Fix json type and add groups
This commit is contained in:
parent
e07d83a89b
commit
32b8e4174b
@ -21,7 +21,8 @@
|
||||
},
|
||||
"dishes": {
|
||||
"group": "dish",
|
||||
"type": "group"
|
||||
"type": "group",
|
||||
"repeatable": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -656,6 +656,31 @@ module.exports = {
|
||||
default:
|
||||
acc.properties[current] = associationSchema;
|
||||
}
|
||||
} else if (type === 'group') {
|
||||
const { repeatable, group, min, max } = attribute;
|
||||
|
||||
const cmp = this.generateMainComponent(
|
||||
strapi.groups[group].attributes
|
||||
);
|
||||
|
||||
if (repeatable) {
|
||||
acc.properties[current] = {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'object',
|
||||
...cmp,
|
||||
},
|
||||
minItems: min,
|
||||
maxItems: max,
|
||||
description,
|
||||
};
|
||||
} else {
|
||||
acc.properties[current] = {
|
||||
type: 'object',
|
||||
...cmp,
|
||||
description,
|
||||
};
|
||||
}
|
||||
} else {
|
||||
acc.properties[current] = {
|
||||
type,
|
||||
@ -1573,6 +1598,8 @@ module.exports = {
|
||||
case 'biginteger':
|
||||
case 'long':
|
||||
return 'integer';
|
||||
case 'json':
|
||||
return 'object';
|
||||
default:
|
||||
return type;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user