Skip to content

[Spring] allowableValues uppercase #4550

@samogot

Description

@samogot
Description

I'm getting uppercased enum values instead of case used in spec. For example:

   ResponseEntity<Text> chapterTextGet(@ApiParam(value = "Pipe delimited list of needed fields.", allowableValues = "TEXTID, TEXTWIKI, TEXTHTML, CONTENTS, FOOTNOTES") @RequestParam(value = "fields", required = false) List<String> fields);

Expected:

   ResponseEntity<Text> chapterTextGet(@ApiParam(value = "Pipe delimited list of needed fields.", allowableValues = "textId, textWiki, textHtml, contents, footnotes") @RequestParam(value = "fields", required = false) List<String> fields);

This values are names of class fields, so case-sensitiveness is important for me

Swagger-codegen version

current master

Swagger declaration file content or url
swagger: '2.0'
info:
  version: '1.0.0'
  title: Test API
host: localhost:8080
basePath: /api
schemes:
  - http
consumes:
  - application/json
produces:
  - application/json
paths:
  /chapterText:
    get:
      parameters:
        - name: fields
          in: query
          description: Pipe delimited list of needed fields.
          required: false
          type: array
          items:
            type: string
            enum:
              - textId
              - textWiki
              - textHtml
              - contents
              - footnotes
          collectionFormat: pipes
          default:
            - textHtml
            - contents
            - footnotes
      responses:
        '200':
          description: text response
          schema:
            $ref: '#/definitions/Text'
definitions:
  Text:
    type: object
    properties:
      textId:
        type: integer
      textWiki:
        type: string
      textHtml:
        type: string
      contents:
        type: string
      footnotes:
        type: string
Command line used for generation
java -jar ~/Downloads/swagger-codegen-cli-2.2.1.jar generate -l spring -i test.yaml -o test/
Steps to reproduce
  1. Generate spring-boot server stub using command line script and spec file above
  2. Look at src/main/java/io/swagger/api/ChapterTextApi.java
Related issues

Don't think it really related, but it may by somewhere near #3792

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions