swagger-api/swagger-codegen

why x-spring-paginated vender extentions doesn't work for me?

Open

#5506 opened on Apr 28, 2017

View on GitHub
 (8 comments) (0 reactions) (0 assignees)HTML (12,701 stars) (5,474 forks)batch import
Issue: BugServer: Springhelp wanted

Description

Description

is there any way to make it works? https://github.com/swagger-api/swagger-codegen/issues/3353 https://github.com/swagger-api/swagger-codegen/pull/3357

json code

  "/pet/findByStatus": {
      "get": {
        "tags": [
          "pet"
        ],
        "summary": "Finds Pets by status",
        "description": "Multiple status values can be provided with comma seperated strings",
        "operationId": "findPetsByStatus",
		"x-spring-paginated": true,
        "produces": [
          "application/json",
          "application/xml"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Status values that need to be considered for filter",
            "required": false,
            "type": "array",
            "items": {
              "type": "string",
              "enum": ["available", "pending", "sold"]
            },
            "collectionFormat": "multi",
            "default": "available"
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Pet"
              }
            },
            "examples": {
              "application/json": {
                "name": "Puma",
                "type": "Dog",
                "color": "Black",
                "gender": "Female",
                "breed": "Mixed"
              }
            }
          },
          "400": {
            "description": "Invalid status value"
          }
        },
        "security": [
          {
            "petstore_auth": [
              "write:pets",
              "read:pets"
            ]
          }
        ]
      }
    }

generated java source

    public ResponseEntity<List<Pet>> findPetsByStatus( @ApiParam(value = "Status values that need to be considered for filter", allowableValues = "AVAILABLE, PENDING, SOLD", defaultValue = "available") @RequestParam(value = "status", required = false, defaultValue="available") List<String> status) {
        // do some magic!
        return new ResponseEntity<List<Pet>>(HttpStatus.OK);
    }

Contributor guide