core
core copied to clipboard
[BUG][2.7.0-rc.2] Cannot setting type for a property has no effect
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
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 ?
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?
This was removed iris I think
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.
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.