Skip to content

Conversation

@soyuka
Copy link
Member

@soyuka soyuka commented Dec 17, 2025

Q A
Branch? 4.2
Tickets na
License MIT
Doc PR na

When using a collection operation with a custom output DTO and itemUriTemplate, the IRI
generation was failing because the system couldn't properly resolve IRIs for mapped
objects that aren't directly registered as API resources.

This enables scenarios where you want different representations for collection vs item
operations:

 #[GetCollection(
     output: BookStoreCollection::class,
     itemUriTemplate: '/book_store_resources/{id}{._format}',
 )]

The collection returns a lightweight DTO while individual items can be accessed with full
details.

@soyuka soyuka force-pushed the fix/collection-output-iri branch from 46c0edd to a637316 Compare December 18, 2025 08:16
@soyuka soyuka force-pushed the fix/collection-output-iri branch from a637316 to c037ded Compare December 18, 2025 14:29
@soyuka soyuka merged commit 40ad568 into api-platform:4.2 Dec 18, 2025
126 of 130 checks passed
@soyuka soyuka deleted the fix/collection-output-iri branch December 18, 2025 14:34
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.

1 participant