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

Response media type is not extracted for @RestController annotation #22

Closed
cc-jhr opened this issue Mar 8, 2019 · 0 comments
Closed
Assignees
Labels
Bug Something isn't working Spring Relates to the SpringConverter
Milestone

Comments

@cc-jhr
Copy link
Collaborator

cc-jhr commented Mar 8, 2019

Setup information
hikaku version: 1.1.0
specification converter: -
implementation converter: SpringConverter
build tool and version: gradle 5.2.1
test framework: junit 5.4.0

Describe the bug
Extracting the response media type is done by checking the @ResponseBody annotation. This is fine for @Controller annotation in combination with @ResponseBody. The @RestControllerannotation combines both already. So in this case the response media type couldn't be extracted.

Expected behavior
Media type is extracted for both cases:

  • @Controller in combination with @ResponseBody
  • @RestController

Code samples:
Can you provide specifications or code snippets?

@Controller
@ResponseBody
open class GetMappingOneMediaTypeIsExtractedCorrectlyController {

    @GetMapping("/todos", produces = [APPLICATION_XML_VALUE])
    fun getAllTodos() = ResponseEntity.status(200).body(GetMappingOneMediaTypeIsExtractedCorrectlyController())
}
@RestController
open class GetMappingOneMediaTypeIsExtractedCorrectlyController {

    @GetMapping("/todos", produces = [APPLICATION_XML_VALUE])
    fun getAllTodos() = ResponseEntity.status(200).body(GetMappingOneMediaTypeIsExtractedCorrectlyController())
}
@cc-jhr cc-jhr added the Bug Something isn't working label Mar 8, 2019
@cc-jhr cc-jhr added this to the v2.0.0 milestone Mar 8, 2019
@cc-jhr cc-jhr added the Spring Relates to the SpringConverter label Mar 8, 2019
@cc-jhr cc-jhr removed this from the v2.0.0 milestone Mar 8, 2019
@cc-jhr cc-jhr self-assigned this Mar 8, 2019
@cc-jhr cc-jhr closed this as completed in 55510e8 Mar 8, 2019
@cc-jhr cc-jhr added this to the 1.1.1 milestone Mar 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Spring Relates to the SpringConverter
Projects
None yet
Development

No branches or pull requests

1 participant