fix hateos collectionModel rule
package springfox.documentation.schema
import com.fasterxml.classmate.TypeResolver
+import org.springframework.hateoas.CollectionModel
import org.springframework.http.ResponseEntity
import spock.lang.Specification
import spock.lang.Unroll
@@ -69,7 +70,7 @@ class AlternateTypeProviderSpec extends Specification {
newRule(nestedGenericType(WildcardType), WildcardType) | nestedGenericType(SimpleType) | SimpleType
mismatchedNestedGenericRule() | nestedGenericType(SimpleType) | nestedGenericType(nestedGenericType(SimpleType))
newRule(genericClassOfType(WildcardType), WildcardType) | nestedGenericType(SimpleType) | resolver.resolve(ResponseEntity, SimpleType)
- hateoasResourcesRule() | resources(SimpleTypeResource) | resolver.resolve(List, SimpleType)
+ hateoasCollectionModelRule() | resources(SimpleTypeResource) | resolver.resolve(List, SimpleType)
}
@Unroll
@@ -97,13 +98,13 @@ class AlternateTypeProviderSpec extends Specification {
newRule(nestedGenericType(WildcardType), WildcardType) | nestedGenericType(SimpleType) | SimpleType
mismatchedNestedGenericRule() | nestedGenericType(SimpleType) | nestedGenericType(nestedGenericType(SimpleType))
newRule(genericClassOfType(WildcardType), WildcardType) | nestedGenericType(SimpleType) | resolver.resolve(ResponseEntity, SimpleType)
- hateoasResourcesRule() | resources(SimpleTypeResource) | resolver.resolve(List, SimpleType)
+ hateoasCollectionModelRule() | resources(SimpleTypeResource) | resolver.resolve(List, SimpleType)
}
- AlternateTypeRule hateoasResourcesRule() {
+ AlternateTypeRule hateoasCollectionModelRule() {
def typeResolver = new TypeResolver()
newRule(
- typeResolver.resolve(Resources.class, SimpleTypeResource.class),
+ typeResolver.resolve(CollectionModel.class, SimpleTypeResource.class),
typeResolver.resolve(List.class, SimpleType.class))
}
