forked from loafle/openapi-generator-original
added big decimal support
This commit is contained in:
parent
8c53837802
commit
a54adb925f
@ -16,8 +16,6 @@
|
||||
|
||||
package com.wordnik.swagger.codegen
|
||||
|
||||
import com.wordnik.swagger.codegen.BasicJavaGenerator
|
||||
|
||||
import com.wordnik.swagger.codegen.model._
|
||||
|
||||
object BasicAndroidJavaClient extends BasicAndroidJavaGenerator {
|
||||
|
@ -16,8 +16,6 @@
|
||||
|
||||
package com.wordnik.swagger.codegen
|
||||
|
||||
import com.wordnik.swagger.codegen.BasicJavaGenerator
|
||||
|
||||
object BasicGroovyGenerator extends BasicGroovyGenerator {
|
||||
def main(args: Array[String]) = generateClient(args)
|
||||
}
|
||||
|
@ -53,6 +53,7 @@ class BasicJavaGenerator extends BasicGenerator {
|
||||
"string" -> "String",
|
||||
"int" -> "Integer",
|
||||
"float" -> "Float",
|
||||
"number" -> "BigDecimal",
|
||||
"long" -> "Long",
|
||||
"short" -> "Short",
|
||||
"char" -> "String",
|
||||
@ -82,6 +83,7 @@ class BasicJavaGenerator extends BasicGenerator {
|
||||
|
||||
// import/require statements for specific datatypes
|
||||
override def importMapping = Map(
|
||||
"BigDecimal" -> "java.math.BigDecimal",
|
||||
"File" -> "java.io.File",
|
||||
"Date" -> "java.util.Date",
|
||||
"Timestamp" -> "java.sql.Timestamp",
|
||||
|
@ -341,7 +341,7 @@ class Codegen(config: CodegenConfig) {
|
||||
|
||||
var baseType = dt
|
||||
// import the object inside the container
|
||||
if (propertyDocSchema.items != null) {
|
||||
if (propertyDocSchema.items != null && !config.typeMapping.contains(dt)) {
|
||||
// import the container
|
||||
imports += Map("import" -> dt)
|
||||
propertyDocSchema.items match {
|
||||
|
@ -16,7 +16,6 @@
|
||||
|
||||
package com.wordnik.swagger.codegen
|
||||
|
||||
import com.wordnik.swagger.codegen.BasicGenerator
|
||||
import com.wordnik.swagger.codegen.spec.SwaggerSpec
|
||||
import com.wordnik.swagger.codegen.model._
|
||||
|
||||
|
@ -23,6 +23,7 @@ object SwaggerSerializers {
|
||||
("integer", "int64") -> "long",
|
||||
("number", "float") -> "float",
|
||||
("number", "double") -> "double",
|
||||
("number", null) -> "BigDecimal",
|
||||
("string", "byte") -> "byte",
|
||||
("string", "date") -> "Date",
|
||||
("string", "date-time") -> "Date",
|
||||
|
Loading…
x
Reference in New Issue
Block a user