java - Swagger Annotation - not to include parameter when there is no parameter? -


i have swagger-jersey2-jaxrs 1.5.1-m2 integrated drop-wizard. have generated following yaml swagger annotations have included on resource , models:

    --- swagger: "2.0" info:   version: "1.0.0"   title: "test application" tags: - name: "test" paths:   /v1/test/version:     get:       tags:       - "v1test"       summary: "version number of test"       description: "returns version number of test"       operationid: "getversionandbuildinfo"       produces:       - "application/json"       parameters:        responses:         404:           description: "build number not found."         200:           description: "successful operation"           schema:             type: "array"             items:               $ref: "#/definitions/testinformation" definitions:   testinformation:     properties:       build:         type: "string"         description: "test build number"       version:         type: "string"         description: "test version number"       buildtimestamp:         type: "string"         description: "test build timestamp"     description: "model test version information" 

notice parameters: include in generated yaml swagger. when paste in swagger editor 2.0 throwing error saying "array short (0), minimum 1".

is there way not generate parameters: in yaml when url not require parameters? didn't include parameter annotation , still shows on generated yaml.

we had bug in json schema swagger definitions didn't allow empty parameters. fixed, , going available in swagger-editor soon.

please follow https://github.com/swagger-api/swagger-editor/issues/395 see when updated.

there's no point trying 'solve' issue in generation process because output not wrong.


Popular posts from this blog