Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

ignore example tag of @ApiParam annotation #154

Open
lucbu01 opened this issue Oct 15, 2019 · 0 comments
Open

ignore example tag of @ApiParam annotation #154

lucbu01 opened this issue Oct 15, 2019 · 0 comments

Comments

@lucbu01
Copy link

lucbu01 commented Oct 15, 2019

I have the problem that my example tag given in the @ApiParam annotation is not shown in the json file or in the yaml file

this is the @ApiParam annotation of my PUT method parameter

@ApiParam(name = "object", value = "full object with changed values", required = true,
    examples = @Example(value = {
        @ExampleProperty(mediaType = "default", value = "{\"#\": \"1ou8d\", \"val\": \"sample\"}")
    }))
Map<String, String> body

this is my build.gradle file

plugins {
  id "com.benjaminsproule.swagger" version "1.0.7"
}

dependencies {
  compile 'io.swagger:swagger-annotations:1.5.15'
}

swagger {
  apiSource {
    springmvc = false
    locations = ['com.domain.storage.impl.SpiderApi', 'com.domain.storage.impl.StorageApi']
    schemes = ['http']
    basePath = '/rest'
    info {
      title = 'Spider API'
      version = 'v1'
      description = 'Spider REST API for store and getting data'
      contact {
          email = '[email protected]'
          name = 'Name'
          url = 'https://domain.com'
      }
    }
    outputFormats = ['json', 'yaml']
    swaggerDirectory = "${project.projectDir}/src/com/domain/storage/impl"
    swaggerFileName = 'spiderapi'
    jsonExampleValues = true
  }
}

and this is the part of the generated yaml file describing this param

...
      - in: "body"
        name: "object"
        description: "full object with changed values"
        required: true
        schema:
          type: "object"
          additionalProperties:
            type: "string"
...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant