# Produkt Extension in MappingData für Erlebniswelt

**URL:** <https://forum.shopware.com/t/produkt-extension-in-mappingdata-fuer-erlebniswelt/96147>\
**Category:** Programmierung\
**Created:** [8. September 2022 um 14:02 UTC](https://forum.shopware.com/t/produkt-extension-in-mappingdata-fuer-erlebniswelt/96147 "2022-09-08T14:02:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ul1](https://avatars.discourse-cdn.com/v4/letter/u/4af34b/32.png) [@ul1](https://forum.shopware.com/u/ul1)\
**Post date:** [8. September 2022 um 14:02 UTC](https://forum.shopware.com/t/produkt-extension-in-mappingdata-fuer-erlebniswelt/96147/1 "2022-09-08T14:02:23Z")

</div>

Hallo zusammen,

Ich habe eine Produkt-Extension geschrieben, die zusätzliche Felder für Produkte bereit hält.  
Jetzt möchte ich, dass diese Felder via DataMapping in einer Erlebniswelt für das DataMapping zur Verfügung stehen.

Ich bin soweit gekommen, dass die Felder, die beim DataMapping auswählbar sind, über den Endpunkt `http://localhost/api/_info/open-api-schema.json` geladen werden.

Als ich `\Shopware\Core\Framework\Api\ApiDefinition\Generator\OpenApi\OpenApiDefinitionSchemaBuilder` überprüft habe, musste ich feststellen, dass „Extensions“ nicht so in das Schema mit aufgenommen werden, dass sie von der Erlebniswelt im Admin gelesen werden.

Hat jemand einen Tipp für mich an welcher Stelle ich ansetzen muss, damit auch meine Extension-Felder in den Erlebniswelten auswählbar werden?

Vielen Dank  
und Liebe Grüße

---

<div class="post-metadata">

**Author:** ![ul1](https://avatars.discourse-cdn.com/v4/letter/u/4af34b/32.png) [@ul1](https://forum.shopware.com/u/ul1)\
**Post date:** [14. September 2022 um 14:25 UTC](https://forum.shopware.com/t/produkt-extension-in-mappingdata-fuer-erlebniswelt/96147/2 "2022-09-14T14:25:19Z")

</div>

> <https://github.com/shopware/platform/issues/2105>
>
> \### PHP Version
> 
> 7.4.23
> 
> \### Shopware Version
> 
> 6.4.4.1
> 
> \### Expected behaviour
> 
> …- Call to http://localhost/api/\_info/open-api-schema.json should list product extension associations and custom entities
> \- Custom entity values referenced via associations from product can be selected in the "Data Mapping" dropdown box of the Shopping Experiences page
> 
> 
> \### Actual behaviour
> 
> I have a custom entity that is referenced by the product via a product extension.
> I want to use the value of one of my entity's attributes in a CMS text block via the Shopping Experiences "\_Data Mapping\_" dropdown box.
> Unfortunately my extension "product.myGreatEntity" is not listed there.
> 
> The root cause seems to be that a GET on http://localhost/api/\_info/open-api-schema.json does not even return the extension. The information from this GET is indirectly used by \_cms.service.js\_.
> There is code in the responsible class \_OpenApiDefinitionSchemaBuilder\_ for this GET request that is considering extensions and assembling an in-memory structure. But the structure returned by \_#getSchemaByDefinition\_ seems wrong with respect to what the calling class \_OpenApi3Generator\_ is expecting.
> 
> I tried to hack-fix the returned structure for extensions in \_OpenApiDefinitionSchemaBuilder\_ but unfortunately could not make it work with reasonable effort. Trying to understand the logic for extensions I looked at the test classes \_OpenApiDefinitionSchemaBuilderTest\_ and \_OpenApi3GeneratorTest\_ but could not find any related test there either.
> 
> 
> \### How to reproduce
> 
> \- Create a custom entity
> \- Create a product extension with an association to that entity
> \- Call http://localhost/api/\_info/open-api-schema.json and see the extensions not being returned
> \- Try to use the entity in a "Data Mapping" in the Shopping Experiences CMS editor

---

<div class="post-metadata">

**Author:** ![Moorleiche](https://avatars.discourse-cdn.com/v4/letter/m/6f9a4e/32.png) [@Moorleiche](https://forum.shopware.com/u/Moorleiche)\
**Post date:** [15. September 2022 um 05:23 UTC](https://forum.shopware.com/t/produkt-extension-in-mappingdata-fuer-erlebniswelt/96147/3 "2022-09-15T05:23:05Z")

</div>

Voten 😉

> **[Shopware Issuetracker](https://issues.shopware.com/issues/NEXT-20818)**
>
> Shopware Issuetracker

---

<div class="post-metadata">

**Author:** ![ul1](https://avatars.discourse-cdn.com/v4/letter/u/4af34b/32.png) [@ul1](https://forum.shopware.com/u/ul1)\
**Post date:** [15. September 2022 um 06:51 UTC](https://forum.shopware.com/t/produkt-extension-in-mappingdata-fuer-erlebniswelt/96147/4 "2022-09-15T06:51:36Z")

</div>

Merci.

Bin noch nicht mit den ganzen Plattformen vertraut.
