Skip to content

Commit

Permalink
Allow resources with multiple mapping values
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-ka committed Nov 1, 2019
1 parent dffe91d commit aec9829
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private Set<Aggregate> discoverAggregates(BoundedContext bc, String packageName)
Set<Aggregate> resultSet = new HashSet<>();
for (Class<?> type : new AnnotationScanner().scanForAnnotatedType(packageName, RequestMapping.class)) {
RequestMapping requestMapping = type.getAnnotation(RequestMapping.class);
if (requestMapping.value().length == 1) {
if (requestMapping.value().length > 0) {
Aggregate aggregate = createAggregate(bc, requestMapping.value()[0]);
aggregate.addEntities(discoverEntities(aggregate.getName(), type));
resultSet.add(aggregate);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright 2019 The Context Mapper Project Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.application.spring.boot.interfaces;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
public class IgnoredResource {

// this resource will be ignored, since the @RequestMapping annotation contains no value

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import test.duplicate.entity.name.model.CustomerId;

@RestController
@RequestMapping({"/customers"})
@RequestMapping({"customers", "second-ignored-mapping"})
public class CustomerInformationHolder {

@PutMapping({"/{customerId}/address"})
Expand Down

0 comments on commit aec9829

Please sign in to comment.