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

Is there anyway that the @ResponseHeader is rendered in json? #937

Closed
MarkVanVenrooij opened this issue Aug 27, 2015 · 4 comments
Closed
Labels
Milestone

Comments

@MarkVanVenrooij
Copy link

Is there anyway to get the response headers in the generated JSON. At this moment I have no clue how to do this.

Example:

@ApiResponse(code = 201, message = "Resource created.",
    responseHeaders = {
        @ResponseHeader(name = "ETag", 
              description = "The version id of the newly created resource", 
              response = String.class)})
.....

Should be available as.

"responses": {
    "201": {
        "description": "Resource created.",
        "headers": {
            "ETag": {
                "type": "string",
                "description": "The version id of the newly created resource."
                }
.....
@dilipkrish dilipkrish added this to the 2.3.0 milestone Aug 27, 2015
@dilipkrish
Copy link
Member

This is currently not supported by the internal models. Thanks for reporting this gap 👍🏼

@dilipkrish
Copy link
Member

@MarkVanVenrooij would you like to try and submit a pr for this?

@dilipkrish dilipkrish modified the milestones: 2.4.0, 2.3.0 Sep 10, 2015
@jjzabkar
Copy link

@dilipkrish : Could you perhaps point to where in the internal model it's not supported? I would be happy to try my hand at a pull request.

@dilipkrish
Copy link
Member

@jjzabkar absolutely! Any help is much appreciated. Below are the steps roughly. Please feel free to ask any questions you might have

private Map<String, ModelProperty> headers; // springfox.documentation.schema.ModelProperty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants