admin管理员组文章数量:1024615
I'm in a pretty strange situation.
the url /api/home-page?populate=* doesn't return my image field but /api/home-page?populate=heroImage does
On the other side I have another single page very similar where populate=* and populate=heroImage are both working fine.
What can explain that problem?
Below the two schema.json
home-page :
{
"kind": "singleType",
"collectionName": "home_pages",
"info": {
"singularName": "home-page",
"pluralName": "home-pages",
"displayName": "Page d'accueil",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"title": {
"type": "string"
},
"description": {
"type": "text"
},
"seo": {
"type": "component",
"repeatable": false,
"component": "shared.seo"
},
"heroImage": {
"type": "media",
"multiple": false,
"required": false,
"allowedTypes": ["images"]
},
"img": {
"allowedTypes": ["images"],
"type": "media",
"multiple": false
}
}
}
the other page :
{
"kind": "singleType",
"collectionName": "ou_trouver_bonuxes",
"info": {
"singularName": "ou-trouver-bonux",
"pluralName": "ou-trouver-bonuxes",
"displayName": "Où trouver Bonux"
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"title": {
"type": "string"
},
"description": {
"type": "text"
},
"heroImage": {
"allowedTypes": [
"images"
],
"type": "media",
"multiple": false
}
}
}
I'm in a pretty strange situation.
the url /api/home-page?populate=* doesn't return my image field but /api/home-page?populate=heroImage does
On the other side I have another single page very similar where populate=* and populate=heroImage are both working fine.
What can explain that problem?
Below the two schema.json
home-page :
{
"kind": "singleType",
"collectionName": "home_pages",
"info": {
"singularName": "home-page",
"pluralName": "home-pages",
"displayName": "Page d'accueil",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"title": {
"type": "string"
},
"description": {
"type": "text"
},
"seo": {
"type": "component",
"repeatable": false,
"component": "shared.seo"
},
"heroImage": {
"type": "media",
"multiple": false,
"required": false,
"allowedTypes": ["images"]
},
"img": {
"allowedTypes": ["images"],
"type": "media",
"multiple": false
}
}
}
the other page :
{
"kind": "singleType",
"collectionName": "ou_trouver_bonuxes",
"info": {
"singularName": "ou-trouver-bonux",
"pluralName": "ou-trouver-bonuxes",
"displayName": "Où trouver Bonux"
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"title": {
"type": "string"
},
"description": {
"type": "text"
},
"heroImage": {
"allowedTypes": [
"images"
],
"type": "media",
"multiple": false
}
}
}
Share
Improve this question
asked Nov 18, 2024 at 12:41
Rom-888Rom-888
8862 gold badges14 silver badges34 bronze badges
1 Answer
Reset to default 0With the populate=* parameter, it returns first-level relations, components and dynamic zones.
You can use Strapi deep populate plugin. Install the plugin
npm i strapi-plugin-populate-deep
and make the requests like
/api/articles?populate=deep
I'm in a pretty strange situation.
the url /api/home-page?populate=* doesn't return my image field but /api/home-page?populate=heroImage does
On the other side I have another single page very similar where populate=* and populate=heroImage are both working fine.
What can explain that problem?
Below the two schema.json
home-page :
{
"kind": "singleType",
"collectionName": "home_pages",
"info": {
"singularName": "home-page",
"pluralName": "home-pages",
"displayName": "Page d'accueil",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"title": {
"type": "string"
},
"description": {
"type": "text"
},
"seo": {
"type": "component",
"repeatable": false,
"component": "shared.seo"
},
"heroImage": {
"type": "media",
"multiple": false,
"required": false,
"allowedTypes": ["images"]
},
"img": {
"allowedTypes": ["images"],
"type": "media",
"multiple": false
}
}
}
the other page :
{
"kind": "singleType",
"collectionName": "ou_trouver_bonuxes",
"info": {
"singularName": "ou-trouver-bonux",
"pluralName": "ou-trouver-bonuxes",
"displayName": "Où trouver Bonux"
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"title": {
"type": "string"
},
"description": {
"type": "text"
},
"heroImage": {
"allowedTypes": [
"images"
],
"type": "media",
"multiple": false
}
}
}
I'm in a pretty strange situation.
the url /api/home-page?populate=* doesn't return my image field but /api/home-page?populate=heroImage does
On the other side I have another single page very similar where populate=* and populate=heroImage are both working fine.
What can explain that problem?
Below the two schema.json
home-page :
{
"kind": "singleType",
"collectionName": "home_pages",
"info": {
"singularName": "home-page",
"pluralName": "home-pages",
"displayName": "Page d'accueil",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"title": {
"type": "string"
},
"description": {
"type": "text"
},
"seo": {
"type": "component",
"repeatable": false,
"component": "shared.seo"
},
"heroImage": {
"type": "media",
"multiple": false,
"required": false,
"allowedTypes": ["images"]
},
"img": {
"allowedTypes": ["images"],
"type": "media",
"multiple": false
}
}
}
the other page :
{
"kind": "singleType",
"collectionName": "ou_trouver_bonuxes",
"info": {
"singularName": "ou-trouver-bonux",
"pluralName": "ou-trouver-bonuxes",
"displayName": "Où trouver Bonux"
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"title": {
"type": "string"
},
"description": {
"type": "text"
},
"heroImage": {
"allowedTypes": [
"images"
],
"type": "media",
"multiple": false
}
}
}
Share
Improve this question
asked Nov 18, 2024 at 12:41
Rom-888Rom-888
8862 gold badges14 silver badges34 bronze badges
1 Answer
Reset to default 0With the populate=* parameter, it returns first-level relations, components and dynamic zones.
You can use Strapi deep populate plugin. Install the plugin
npm i strapi-plugin-populate-deep
and make the requests like
/api/articles?populate=deep
本文标签: javascriptStrapi api doesn39t return image fieldStack Overflow
版权声明:本文标题:javascript - Strapi api doesn't return image field - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745617622a2159385.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论