Support to receive aggregate references as request parameters.
We now support using AggregateReference as type to bind request parameters taking URIs pointing to related aggregates. The default resolution will try to resolve the entire URI via UriToEntityConverter but one can also provide a function that can extract any part of the URI to be then resolved into either an identifier, aggregate instance or jMolecules Association against the ConversionService. Fixes #2239.
This commit is contained in:
@@ -116,16 +116,18 @@ class RepositoryTestsConfig {
|
||||
@Bean
|
||||
public Module persistentEntityModule() {
|
||||
|
||||
var conversionService = new DefaultConversionService();
|
||||
|
||||
RepositoryResourceMappings mappings = new RepositoryResourceMappings(repositories(), persistentEntities(),
|
||||
config());
|
||||
EntityLinks entityLinks = new RepositoryEntityLinks(repositories(), mappings, config(),
|
||||
mock(PagingAndSortingTemplateVariables.class), PluginRegistry.of(DefaultIdConverter.INSTANCE));
|
||||
SelfLinkProvider selfLinkProvider = new DefaultSelfLinkProvider(persistentEntities(), entityLinks,
|
||||
Collections.emptyList(), new DefaultConversionService());
|
||||
Collections.emptyList(), conversionService);
|
||||
|
||||
DefaultRepositoryInvokerFactory invokerFactory = new DefaultRepositoryInvokerFactory(repositories());
|
||||
UriToEntityConverter uriToEntityConverter = new UriToEntityConverter(persistentEntities(), invokerFactory,
|
||||
repositories());
|
||||
() -> conversionService);
|
||||
|
||||
Associations associations = new Associations(mappings, config());
|
||||
LinkCollector collector = new DefaultLinkCollector(persistentEntities(), selfLinkProvider, associations);
|
||||
|
||||
Reference in New Issue
Block a user