Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter not checked correctly when AliasFor is used in annotation #2

Open
fjakop opened this issue Jan 8, 2019 · 0 comments
Open

Comments

@fjakop
Copy link
Contributor

fjakop commented Jan 8, 2019

Given an annotated method like

import org.springframework.web.bind.annotation.*;

public class MyClass {
  @GetMapping(produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
  public ResponseEntity<Map<String, Result>> myMethod() { ... } 
}

the following validation fails

@Test
public void annotations() throws Exception {
    AnnotationValidator.validate().exactly()
            .annotation(type(GetMapping.class)
                .param("produces", MediaType.APPLICATION_JSON_UTF8_VALUE))
            .forMethod(MyClass.class.getDeclaredMethod("myMethod"));
} 

the functional equal annotated method is validated (when adding the method param)

@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseEntity<Map<String, Result>> myMethod() { ... } 

We are using version 1.2.

@fjakop fjakop changed the title Parameter not checked correctly when AliasFor is used inannotation Parameter not checked correctly when AliasFor is used in annotation Jan 8, 2019
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

No branches or pull requests

1 participant