core icon indicating copy to clipboard operation
core copied to clipboard

[BUG][2.7.0-rc.2] Cannot setting type for a property has no effect

Open silverbackdan opened this issue 3 years ago • 4 comments
trafficstars

API Platform version(s) affected: 2.7.0-beta.4 (backwards compatibility is off)

Description
It appears that I can no longer set the schema.org type using XML for a property.

How to reproduce

    <property resource="Silverback\ApiComponentsBundle\Model\Uploadable\MediaObject"
              name="formattedFileSize"
              writable="false"
    >
        <types>
            <type>http://schema.org/contentSize</type>
        </types>
    </property>

The @context property is still MediaObject/formattedFileSize and this used to work just fine. I have automated tests checking for this in my application.

Possible Solution
Have not been able to trace the issue or change just yet.

Additional Context
n/a

silverbackdan avatar Jul 11 '22 14:07 silverbackdan

Hi, just wondering if there is any news on this feature that seems to be broken, or is there another way I should be setting this now? Thanks :) Would appreciate a look when you have a moment if poss @soyuka ?

silverbackdan avatar Aug 11 '22 15:08 silverbackdan

I've had a look and I'm not sure what changed in the context builder but it seems it'll only use the id (i.e. the IRI) now as it builds the context for the properties. This had worked before though so perhaps it's a deprecated feature in the upcoming 3.0?

silverbackdan avatar Aug 11 '22 18:08 silverbackdan

This was removed iris I think

soyuka avatar Sep 17 '22 15:09 soyuka

Sorry I'm not sure I understand - I noticed in the API Platform Con presentation there was an example using schema.org schemas in the annotations using the equivalent types/type as I have defined in my xml.

silverbackdan avatar Sep 20 '22 09:09 silverbackdan

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 05 '23 16:01 stale[bot]