swagger-api/swagger-codegen

[java][jaxrs] codegen fails on nested lists trys to put generic in class name

Open

#5,327 建立於 2017年4月4日

在 GitHub 查看
 (2 留言) (0 反應) (0 負責人)HTML (5,474 fork)batch import
Issue: BugServer: Javahelp wanted

倉庫指標

Star
 (12,701 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Description

output code for list of list of double includes invalid java List<Double>.class Note that a list of doubles is generated correctly but a list of list of doubles is not.

Swagger-codegen version

2.2.2

Swagger declaration file content or url
swagger: '2.0'

info:
  title: example
  version: "0"

paths:
  /go:
    get:
      responses:
        200:
          description: "success"
          schema:
            type: array
            items: 
              type: array
              items:
                type: number
                format: double

this outputs invalid java to src/gen/java/io/swagger/api/GoApi.java

Command line used for generation

swagger-codegen generate --lang jaxrs --library jersey2 -i nowork.yaml

Steps to reproduce

create a file called nowork.yaml with the text given. run the command swagger-codegen generate --lang jaxrs --library jersey2 -i nowork.yaml from the directory containing nowork.yaml observe the generated file src/gen/java/io/swagger/api/GoApi.java it contains the bad java code List<Double>.class

貢獻者指南