Skip to content

NPE in HttpResponseSnippet when documenting a response with a custom HTTP status #652

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

Closed
flo076 opened this issue Oct 17, 2019 · 1 comment
Labels
status: superseded Superseded by another issue type: bug A bug

Comments

@flo076
Copy link

flo076 commented Oct 17, 2019

Hello,

In my mind, the issue #639 does not seem to be finished.

We have an exception, with spring-restdocs.version in version 2.0.4.RELEASE, when try to generate documentation for an endpoint that returns

return ResponseEntity.status(215).body(elements)

The exception :

java.lang.NullPointerException
	at org.springframework.restdocs.http.HttpResponseSnippet.createModel(HttpResponseSnippet.java:62)
	at org.springframework.restdocs.snippet.TemplatedSnippet.document(TemplatedSnippet.java:78)
	at org.springframework.restdocs.generate.RestDocumentationGenerator.handle(RestDocumentationGenerator.java:191)
	at org.springframework.restdocs.mockmvc.RestDocumentationResultHandler.handle(RestDocumentationResultHandler.java:52)
	at org.springframework.test.web.servlet.MockMvc.applyDefaultResultActions(MockMvc.java:224)
	at org.springframework.test.web.servlet.MockMvc.perform(MockMvc.java:190)
@wilkinsona wilkinsona added type: bug A bug and removed status: waiting-for-triage Untriaged issue labels Oct 17, 2019
@wilkinsona wilkinsona changed the title NPE : Responses with custom HTTP statuses cannot be documented NPE in HttpResponseSnippet when documenting a response with a custom HTTP status Oct 17, 2019
@wilkinsona
Copy link
Member

Closing in favour of #653.

@wilkinsona wilkinsona added the status: superseded Superseded by another issue label Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded Superseded by another issue type: bug A bug
Projects
None yet
Development

No branches or pull requests

3 participants