Skip to content
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

Normalize returned types by the api #84

Open
alexander-schranz opened this issue Apr 7, 2021 · 1 comment
Open

Normalize returned types by the api #84

alexander-schranz opened this issue Apr 7, 2021 · 1 comment
Labels
DX Only affecting the end developer

Comments

@alexander-schranz
Copy link
Member

alexander-schranz commented Apr 7, 2021

There are current different type returned. First the structure resolver return a singular type e.g.:

{
    "uuid": "...",
    "type": "page",
}

But then there is the teaser_selection which will return a pluralized resource key e.g.:

{
    "uuid": "...",
    "type": "pages",
}

I think this could be a little bit confusing and I think we should have in future a type represented in one form. In sulu internal the resourceKey is pluralized (contacts, examples, accounts, media). So maybe it should only exist this form.

@alexander-schranz alexander-schranz added the DX Only affecting the end developer label Apr 7, 2021
@alexander-schranz
Copy link
Member Author

alexander-schranz commented Apr 7, 2021

Until we switch in sulu core from singular to pluralized keys in the template keys (https://github.com/sulu/sulu/blob/34ef10a83648877617f4b89a285a6f10fcf15289/src/Sulu/Bundle/PageBundle/DependencyInjection/SuluPageExtension.php#L161) or in the teaser providers (https://github.com/sulu/sulu/blob/6c08bf8df4bc493cea8a619409d2fd5bc320726e/src/Sulu/Bundle/PageBundle/Resources/config/teaser.xml#L19) we could also work in SuluHeadlessBundle around it using the Inflector to be consistent atleast in the returned Api.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Only affecting the end developer
Projects
None yet
Development

No branches or pull requests

1 participant