Skip to content

Producing "x-example" with @ApiParam for @PathVariable #2253

@kilsbo

Description

@kilsbo

I'm curious about getting "x-example" in the json output using annotations in Spring REST controllers.

Currently, I'm attempting this in my controller:

@Override public ResponseEntity<Object> update( @RequestBody @Valid UpdateCampaignRequest updateCampaignRequest, @ApiParam(name = "campaign_id", example = "1", required = true) @PathVariable("campaign_id") Long campaignId) { ... } 

...in the method parameters of the rest controller method signature.

This however, produces no x-example in the swagger json output (converted to yml by me):

parameters: - name: campaign_id in: path description: campaign_id required: true type: integer format: int64 

Is there another way to accomplish this?

These are my dependencies:

<dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.8.0</version> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.8.0</version> </dependency> 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions