Skip to content

Include information on how to show names instead of IRIs for entities #785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 11, 2019
Merged

Include information on how to show names instead of IRIs for entities #785

merged 4 commits into from
Apr 11, 2019

Conversation

Cydonia7
Copy link
Contributor

@Cydonia7 Cydonia7 commented Apr 11, 2019

By default, without more information, the admin shows IRIs for entities.

This makes it really hard for actual users to parse the information, especially when seeing relations this way. This is an attempt to document how to solve the problem marking the property with Schema.org (thanks @GregoireHebert for the tip in the first place)

@Cydonia7
Copy link
Contributor Author

@alanpoulain I've done a bit of work with help from Gregoire if you want to check it out again!

@alanpoulain
Copy link
Member

Nice work!

alanpoulain and others added 3 commits April 11, 2019 14:20
Co-Authored-By: Cydonia7 <Cydonia7@users.noreply.github.com>
Co-Authored-By: Cydonia7 <Cydonia7@users.noreply.github.com>
Co-Authored-By: Cydonia7 <Cydonia7@users.noreply.github.com>

## Open Vocabulary Generated from Validation Metadata

API Platform automatically detects Symfony's built-in validators and generates schema.org IRI metadata accordingly. This allows for rich clients such as the Admin component to infer the field types for most basic use cases.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know API Platform does this. It's bad as it's anybody's guess whether it's correct or not. 😞

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's just basic type coverage, it does not prevent you to set your own types.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that it might set the wrong type, when in fact, it's perfectly fine without. It's a bad kind of magic.

@alanpoulain alanpoulain merged commit 81051ca into api-platform:2.4 Apr 11, 2019
@alanpoulain
Copy link
Member

Thank you @Cydonia7!

@Cydonia7 Cydonia7 deleted the name-property branch April 11, 2019 14:13
jordanaubert pushed a commit to jordanaubert/docs that referenced this pull request Apr 14, 2019
* Added yaml config to security page as indicated in api-platform#785.

* Corrected method and admin message for collection post example.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants