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

Generator incompatible with current api-platform template #390

Open
wstnbrg opened this issue Dec 30, 2024 · 0 comments
Open

Generator incompatible with current api-platform template #390

wstnbrg opened this issue Dec 30, 2024 · 0 comments

Comments

@wstnbrg
Copy link

wstnbrg commented Dec 30, 2024

API Platform version(s) affected: x.y.z

Description

When using the latest github template for api-platform (currently commit ) and running the command to generate a next compontent: docker compose exec pwa pnpm create @api-platform/client -g next the generated list component is not compatible (list for entity not showing/only blank page).

How to reproduce

  1. create a new api using template
  2. generate nextjs client: docker compose exec pwa pnpm create @api-platform/client -g next
  3. visit https://localhost/greetings

Possible Solution

The generated PageList component has a check for !collection["hydra:member"] - but with default values of the template there is no 'hydra:' prefix for the members of the collection. It should check and use collection["member"] instead.

Additional Context

Generated components are compatible when enabling hydra prefix for serializer (api-platform/api-platform#2827) - but as suggested there it may be changed in the generator itself.

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

No branches or pull requests

1 participant