Swift4Codegen.java does not have type mapping for bigdecimal. Even if we add the below line
typeMapping.put("bigdecimal", "Double");
in Swift4Codegen.java and compile the jar and run it. it gives the below error
[main] WARN io.swagger.util.PropertyDeserializer - no property from bigdecimal, null, {ENUM=null, TITLE=null, DESCRIPTION=null, DEFAULT=null, PATTERN=null, DESCRIMINATOR=null, MIN_ITEMS=null, MAX_ITEMS=null, MIN_PROPERTIES=null, MAX_PROPERTIES=null, MIN_LENGTH=null, MAX_LENGTH=null, MINIMUM=null, MAXIMUM=null, EXCLUSIVE_MINIMUM=null, EXCLUSIVE_MAXIMUM=null, UNIQUE_ITEMS=null, EXAMPLE=null, TYPE=bigdecimal, FORMAT=null, READ_ONLY=null, VENDOR_EXTENSIONS={}, MULTIPLE_OF=null}
master code
swagger: "2.0"
info:
description: "Testing the swagger YAML to swift 4"
version: "1.0.0"
title: "testing swift"
contact:
email: "[email protected]"
license:
name: "sample code"
host: "localhost:8080"
basePath: "/v2"
schemes:
- "http"
paths:
/user:
put:
summary: "Updated user"
description: "This can only be done by the logged in user."
operationId: "updateUser"
produces:
- "application/json"
parameters:
- in: "body"
name: "user"
description: "Updated user object"
required: true
schema:
$ref: "#/definitions/User"
responses:
400:
description: "Invalid user supplied"
404:
description: "User not found"
definitions:
User:
type: "object"
properties:
desk:
type: "bigdecimal"
firstName:
type: "string"
swagger-codegen generate -i swagger_1.yaml -l swift4
always
if I change my yaml and convert the
definitions:
User:
type: "object"
properties:
desk:
type: "number"
firstName:
type: "string"
then it works fine.
please tell me if 'number' should be used for big decimal in yaml? so that it gets converted to Double in swift?
Also seeing this issue
Most helpful comment
Also seeing this issue