Skip to content

Generator incompatible with current api-platform template #390

Open
@wstnbrg

Description

@wstnbrg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions