Closed
Description
Hi Swagger-Codegen team,
I just updated my local copy to the latest version, 2.1.2 and I am receiving the following error:
....
writing file /Users/ali/IdeaProjects/sensorfront-java-client2/src/main/java/io/swagger/client/model/SensorCreateUpdateRequest.java
writing file /Users/ali/IdeaProjects/sensorfront-java-client2/src/main/java/io/swagger/client/model/SensorDataAggregation.java
writing file /Users/ali/IdeaProjects/sensorfront-java-client2/src/main/java/io/swagger/client/model/SensorSummary.java
java.lang.NullPointerException
at java.util.regex.Matcher.getTextLength(Matcher.java:1234)
at java.util.regex.Matcher.reset(Matcher.java:308)
at java.util.regex.Matcher.<init>(Matcher.java:228)
at java.util.regex.Pattern.matcher(Pattern.java:1088)
at io.swagger.codegen.DefaultCodegen.camelize(DefaultCodegen.java:1237)
at io.swagger.codegen.DefaultCodegen.camelize(DefaultCodegen.java:1212)
at io.swagger.codegen.languages.JavaClientCodegen.toModelName(JavaClientCodegen.java:179)
at io.swagger.codegen.languages.JavaClientCodegen.getSwaggerType(JavaClientCodegen.java:215)
at io.swagger.codegen.DefaultCodegen.getTypeDeclaration(DefaultCodegen.java:490)
at io.swagger.codegen.languages.JavaClientCodegen.getTypeDeclaration(JavaClientCodegen.java:200)
at io.swagger.codegen.languages.JavaClientCodegen.getTypeDeclaration(JavaClientCodegen.java:193)
at io.swagger.codegen.languages.JavaClientCodegen.getTypeDeclaration(JavaClientCodegen.java:193)
at io.swagger.codegen.DefaultCodegen.fromProperty(DefaultCodegen.java:606)
at io.swagger.codegen.DefaultCodegen.addVars(DefaultCodegen.java:1191)
at io.swagger.codegen.DefaultCodegen.fromModel(DefaultCodegen.java:540)
at io.swagger.codegen.DefaultGenerator.processModels(DefaultGenerator.java:451)
at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:125)
at io.swagger.codegen.cmd.Generate.run(Generate.java:124)
at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
Here is the swagger json for SensorSummary
{ "apiVersion" : "1.0.0",
"apis" : [ { "operations" : [ { "deprecated" : false,
"method" : "POST",
"nickname" : "DownloadAggregatedData",
"notes" : "Maximum body size is 1MB (1024KB). Timestamp is in UTC format (number if milliseconds since epoch).",
"parameters" : [ { "description" : "Download Request",
"name" : "body",
"paramType" : "body",
"required" : true,
"type" : "DownloadAggregatedDataRequest"
} ],
"position" : 0,
"responseMessages" : [ { "code" : 200,
"message" : "OK"
},
{ "code" : 400,
"message" : "One or more security tokens are invalid (badly formatted or don't exist any more)"
}
],
"summary" : "This API call is used for retrieving aggregated data of one or more sensors The request body must be in application/json format. ",
"type" : "DownloadAggregatedDataResponse"
} ],
"path" : "/rest/data/download/aggregate"
},
{ "operations" : [ { "deprecated" : false,
"method" : "POST",
"nickname" : "DownloadRawData",
"notes" : "Maximum body size is 1MB (1024KB). Timestamp is in UTC format (number if milliseconds since epoch).",
"parameters" : [ { "description" : "Download Request",
"name" : "body",
"paramType" : "body",
"required" : true,
"type" : "DownloadRawDataRequest"
} ],
"position" : 0,
"responseMessages" : [ { "code" : 200,
"message" : "OK"
},
{ "code" : 400,
"message" : "One or more security tokens are invalid (badly formatted or don't exist any more)"
}
],
"summary" : "This API call is used for retrieving raw data and tags from one or more sensors The request body must be in application/json format. ",
"type" : "DownloadRawDataResponse"
} ],
"path" : "/rest/data/download/raw"
},
{ "operations" : [ { "deprecated" : false,
"method" : "POST",
"nickname" : "DownloadSummarizedData",
"notes" : "Maximum body size is 1MB (1024KB). Timestamp is in UTC format (number if milliseconds since epoch).",
"parameters" : [ { "description" : "Download Request",
"name" : "body",
"paramType" : "body",
"required" : true,
"type" : "DownloadSummarizedDataRequest"
} ],
"position" : 0,
"responseMessages" : [ { "code" : 200,
"message" : "OK"
},
{ "code" : 400,
"message" : "One or more security tokens are invalid (badly formatted or don't exist any more)"
}
],
"summary" : "This API call is used for retrieving summarized aggregated data (merged aggregated data into one aggregation point)of one or more sensors The request body must be in application/json format. ",
"type" : "DownloadSummarizedDataResponse"
} ],
"path" : "/rest/data/download/summary"
},
{ "operations" : [ { "deprecated" : false,
"method" : "POST",
"nickname" : "UploadData",
"notes" : "Maximum body size is 1MB (1024KB). Timestamp is in UTC format (number if milliseconds since epoch).",
"parameters" : [ { "description" : "Upload Request",
"name" : "body",
"paramType" : "body",
"required" : true,
"type" : "UploadDataRequest"
} ],
"position" : 0,
"responseMessages" : [ { "code" : 200,
"message" : "OK"
},
{ "code" : 400,
"message" : "Bad request sent to server."
}
],
"summary" : "This API call is used for uploading data into SensorFront. Each request can be at most 1MB in size. Split larger requests into 1MB (or smaller) requests. You can use this API to upload data for multiple sensors at the same time. ",
"type" : "void"
} ],
"path" : "/rest/data/upload"
}
],
"basePath" : "http://localhost:8080",
"consumes" : [ "application/json" ],
"models" : { "DataAggregation" : { "id" : "DataAggregation",
"name" : "DataAggregation",
"properties" : { "t" : { "format" : "int32",
"position" : 0,
"type" : "integer"
},
"v" : { "items" : { "format" : "double",
"type" : "number"
},
"position" : 0,
"type" : "array"
}
},
"qualifiedType" : "com.sensorfront.backend.rest.protocols.DataAggregation",
"required" : [ "t",
"v"
]
},
"DataPoint" : { "id" : "DataPoint",
"name" : "DataPoint",
"properties" : { "t" : { "format" : "int32",
"position" : 0,
"type" : "integer"
},
"v" : { "format" : "double",
"position" : 0,
"type" : "number"
}
},
"qualifiedType" : "com.sensorfront.backend.rest.protocols.DataPoint",
"required" : [ "t" ]
},
"DataPointTag" : { "id" : "DataPointTag",
"name" : "DataPointTag",
"properties" : { "t" : { "format" : "int32",
"position" : 0,
"type" : "integer"
},
"v" : { "items" : { "type" : "string" },
"position" : 0,
"type" : "array",
"uniqueItems" : true
}
},
"qualifiedType" : "com.sensorfront.backend.rest.protocols.DataPointTag",
"required" : [ "t",
"v"
]
},
"DataPointTags" : { "id" : "DataPointTags",
"name" : "DataPointTags",
"properties" : { "id" : { "position" : 0,
"type" : "string"
},
"tags" : { "items" : { "$ref" : "DataPointTag" },
"position" : 0,
"type" : "array"
}
},
"qualifiedType" : "com.sensorfront.backend.rest.protocols.DataPointTags",
"required" : [ "id",
"tags"
]
},
"DownloadAggregatedDataRequest" : { "id" : "DownloadAggregatedDataRequest",
"name" : "DownloadAggregatedDataRequest",
"properties" : { "from" : { "format" : "int32",
"position" : 0,
"type" : "integer"
},
"includeAverage" : { "description" : "Default is true",
"position" : 0,
"type" : "boolean"
},
"includeCount" : { "description" : "Default is true",
"position" : 0,
"type" : "boolean"
},
"includeMaxTsOfEachBucket" : { "description" : "Default is true",
"position" : 0,
"type" : "boolean"
},
"includeMaximum" : { "description" : "Default is true",
"position" : 0,
"type" : "boolean"
},
"includeMinTsOfEachBucket" : { "description" : "Default is true",
"position" : 0,
"type" : "boolean"
},
"includeMinimum" : { "description" : "Default is true",
"position" : 0,
"type" : "boolean"
},
"includeStandardDev" : { "description" : "Default is true",
"position" : 0,
"type" : "boolean"
},
"includeValueForMaxTsOfEachBucket" : { "description" : "Default is true.",
"position" : 0,
"type" : "boolean"
},
"includeValueForMinTsOfEachBucket" : { "description" : "Default is true",
"position" : 0,
"type" : "boolean"
},
"level" : { "description" : "Set the aggregation level for downloading summarized data",
"enum" : [ "OneYear",
"OneMonth",
"OneDay",
"OneHour",
"FifteenMinutes",
"OneMinute"
],
"position" : 0,
"type" : "string"
},
"sensors" : { "items" : { "type" : "string" },
"position" : 0,
"type" : "array",
"uniqueItems" : true
},
"to" : { "format" : "int32",
"position" : 0,
"type" : "integer"
},
"user_read_token" : { "position" : 0,
"type" : "string"
}
},
"qualifiedType" : "com.sensorfront.backend.rest.protocols.DownloadAggregatedDataRequest",
"required" : [ "level",
"sensors",
"includeMinimum",
"includeMaximum",
"includeAverage",
"includeStandardDev",
"includeCount",
"includeMinTsOfEachBucket",
"includeMaxTsOfEachBucket",
"includeValueForMinTsOfEachBucket",
"includeValueForMaxTsOfEachBucket"
]
},
"DownloadAggregatedDataResponse" : { "id" : "DownloadAggregatedDataResponse",
"name" : "DownloadAggregatedDataResponse",
"properties" : { "headers" : { "items" : { "type" : "string" },
"position" : 0,
"type" : "array"
},
"summary" : { "items" : { "$ref" : "SensorDataAggregation" },
"position" : 1,
"type" : "array"
}
},
"qualifiedType" : "com.sensorfront.backend.rest.protocols.DownloadAggregatedDataResponse",
"required" : [ "headers",
"summary"
]
},
"DownloadRawDataRequest" : { "id" : "DownloadRawDataRequest",
"name" : "DownloadRawDataRequest",
"properties" : { "from" : { "format" : "int32",
"position" : 0,
"type" : "integer"
},
"includeData" : { "description" : "Default is false",
"position" : 0,
"type" : "boolean"
},
"includeTags" : { "description" : "Default is false",
"position" : 0,
"type" : "boolean"
},
"sensors" : { "items" : { "type" : "string" },
"position" : 0,
"type" : "array",
"uniqueItems" : true
},
"to" : { "format" : "int32",
"position" : 0,
"type" : "integer"
},
"user_read_token" : { "position" : 0,
"type" : "string"
}
},
"qualifiedType" : "com.sensorfront.backend.rest.protocols.DownloadRawDataRequest",
"required" : [ "includeData",
"includeTags",
"sensors"
]
},
"DownloadRawDataResponse" : { "id" : "DownloadRawDataResponse",
"name" : "DownloadRawDataResponse",
"properties" : { "data" : { "items" : { "$ref" : "SensorData" },
"position" : 0,
"type" : "array"
},
"tags" : { "items" : { "$ref" : "DataPointTags" },
"position" : 0,
"type" : "array"
}
},
"qualifiedType" : "com.sensorfront.backend.rest.protocols.DownloadRawDataResponse",
"required" : [ "data" ]
},
"DownloadSummarizedDataRequest" : { "id" : "DownloadSummarizedDataRequest",
"name" : "DownloadSummarizedDataRequest",
"properties" : { "from" : { "format" : "int32",
"position" : 0,
"type" : "integer"
},
"includeAverage" : { "description" : "Default is true",
"position" : 0,
"type" : "boolean"
},
"includeCount" : { "description" : "Default is true",
"position" : 0,
"type" : "boolean"
},
"includeMaxTsOfEachBucket" : { "description" : "Default is true",
"position" : 0,
"type" : "boolean"
},
"includeMaximum" : { "description" : "Default is true",
"position" : 0,
"type" : "boolean"
},
"includeMinTsOfEachBucket" : { "description" : "Default is true",
"position" : 0,
"type" : "boolean"
},
"includeMinimum" : { "description" : "Default is true",
"position" : 0,
"type" : "boolean"
},
"includeStandardDev" : { "description" : "Default is true",
"position" : 0,
"type" : "boolean"
},
"includeValueForMaxTsOfEachBucket" : { "description" : "Default is true.",
"position" : 0,
"type" : "boolean"
},
"includeValueForMinTsOfEachBucket" : { "description" : "Default is true",
"position" : 0,
"type" : "boolean"
},
"level" : { "description" : "Set the aggregation level for downloading summarized data",
"enum" : [ "OneYear",
"OneMonth",
"OneDay",
"OneHour",
"FifteenMinutes",
"OneMinute"
],
"position" : 0,
"type" : "string"
},
"sensors" : { "items" : { "type" : "string" },
"position" : 0,
"type" : "array",
"uniqueItems" : true
},
"to" : { "format" : "int32",
"position" : 0,
"type" : "integer"
},
"user_read_token" : { "position" : 0,
"type" : "string"
}
},
"qualifiedType" : "com.sensorfront.backend.rest.protocols.DownloadSummarizedDataRequest",
"required" : [ "level",
"sensors",
"includeMinimum",
"includeMaximum",
"includeAverage",
"includeStandardDev",
"includeCount",
"includeMinTsOfEachBucket",
"includeMaxTsOfEachBucket",
"includeValueForMinTsOfEachBucket",
"includeValueForMaxTsOfEachBucket"
]
},
"DownloadSummarizedDataResponse" : { "id" : "DownloadSummarizedDataResponse",
"name" : "DownloadSummarizedDataResponse",
"properties" : { "headers" : { "items" : { "type" : "string" },
"position" : 0,
"type" : "array"
},
"summary" : { "items" : { "$ref" : "SensorSummary" },
"position" : 1,
"type" : "array"
}
},
"qualifiedType" : "com.sensorfront.backend.rest.protocols.DownloadSummarizedDataResponse",
"required" : [ "headers",
"summary"
]
},
"SensorData" : { "id" : "SensorData",
"name" : "SensorData",
"properties" : { "data" : { "items" : { "$ref" : "DataPoint" },
"position" : 0,
"type" : "array"
},
"id" : { "position" : 0,
"type" : "string"
}
},
"qualifiedType" : "com.sensorfront.backend.rest.protocols.SensorData",
"required" : [ "id",
"data"
]
},
"SensorDataAggregation" : { "id" : "SensorDataAggregation",
"name" : "SensorDataAggregation",
"properties" : { "data" : { "items" : { "$ref" : "DataAggregation" },
"position" : 1,
"type" : "array"
},
"id" : { "position" : 0,
"type" : "string"
}
},
"qualifiedType" : "com.sensorfront.backend.rest.protocols.SensorDataAggregation",
"required" : [ "id",
"data"
]
},
"SensorSummary" : { "id" : "SensorSummary",
"name" : "SensorSummary",
"properties" : { "id" : { "position" : 0,
"type" : "string"
},
"v" : { "items" : { "format" : "double",
"type" : "number"
},
"position" : 0,
"type" : "array"
}
},
"qualifiedType" : "com.sensorfront.backend.rest.protocols.SensorSummary",
"required" : [ "id",
"v"
]
},
"UploadDataRequest" : { "id" : "UploadDataRequest",
"name" : "UploadDataRequest",
"properties" : { "data" : { "items" : { "$ref" : "SensorData" },
"position" : 0,
"type" : "array"
},
"tags" : { "items" : { "$ref" : "DataPointTags" },
"position" : 0,
"type" : "array"
},
"write_token" : { "position" : 0,
"type" : "string"
}
},
"qualifiedType" : "com.sensorfront.backend.rest.protocols.UploadDataRequest",
"required" : [ "write_token",
"data",
"tags"
]
}
},
"produces" : [ "application/json" ],
"protocols" : [ "http" ],
"resourcePath" : "/rest/data",
"swaggerVersion" : "1.2"
}
I don't know if it matters or not, I am using Scalatra 2.4, Scala 2.11.6.
I appreciate your advise,
Ali
Metadata
Metadata
Assignees
Labels
No labels