Skip to content

Hydra docs#594

Merged
vincentchalamon merged 4 commits into4.3from
hydra-docs
Mar 27, 2026
Merged

Hydra docs#594
vincentchalamon merged 4 commits into4.3from
hydra-docs

Conversation

@soyuka
Copy link
Copy Markdown
Member

@soyuka soyuka commented Feb 10, 2026

Q A
Branch? main
Tickets Related to api-platform/core#7746
License MIT

This PR demonstrates an issue and potential solution when using multiple #[ApiResource] attributes on a single entity with different URI templates.

When a resource class has multiple #[ApiResource] declarations with different URI templates (e.g., /admin/multi_route_books and /multi_route_books), the client generator only generates types for the resource that appears in the JSON-LD entrypoint, typically missing the other routes.

Example:

  #[ApiResource(uriTemplate: '/admin/multi_route_books')]
  #[ApiResource(uriTemplate: '/multi_route_books')]
  class MultipleResourceBook

Using 2 different shortName will do the trick, api-platform/core#7746 will fix the behavior (as without the patch this won't work).

We'll also add an automatic way of handling this inside API Platform so this PR may not be needed in the end (for now its just a showcase).

We also need to test that @api-platform/admin is still working.

@vincentchalamon vincentchalamon changed the base branch from 4.2 to 4.3 March 16, 2026 16:08
soyuka added a commit to soyuka/core that referenced this pull request Mar 17, 2026
…DocumentationNormalizer

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Tickets       | api-platform/demo#594
| License       | MIT
| Doc PR        | ∅

When hydra_prefix is false (default since 4.x), $hydraPrefix concatenation
produces bare terms ("member", "Collection") that JSON-LD expands as relative
IRIs instead of Hydra namespace IRIs, breaking api-doc-parser.
@vincentchalamon vincentchalamon force-pushed the hydra-docs branch 2 times, most recently from 54f2879 to 22bfb0b Compare March 26, 2026 07:31
@vincentchalamon vincentchalamon merged commit 45ea3ec into 4.3 Mar 27, 2026
10 of 11 checks passed
@vincentchalamon vincentchalamon deleted the hydra-docs branch March 27, 2026 10:43
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.

2 participants