Skip to content

Generator incompatible with current api-platform template #390

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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