yonaskolb / SwagGen

OpenAPI/Swagger 3.0 Parser and Swift code generator
MIT License
626 stars 146 forks source link

Property type Decimal instead of Double #184

Closed benrudhart closed 3 years ago

benrudhart commented 5 years ago

My yaml defines the property of a model with type number. This generates the Swift type Double.

I'm looking for a way to automatically generate a Swift Decimal. I thought something like this should work, but format is ignored in this case (generates Swift Double)

 Foo:
      properties:
        bar:
          type: number
          format: decimal
lemoinem commented 5 years ago

We have the same issue. At the very least, it would be nice to have an option to choose whether to use float/double or decimal type for non-integer numbers.

benrudhart commented 4 years ago

any updates on this one? @lemoinem how do you handle this?

lemoinem commented 4 years ago

@benrudhart Unfortunately, our solution was to use something other than SwagGen for our code generation needs. Sorry.

benrudhart commented 4 years ago

mh I see. @lemoinem which generator are you using now?

nickaroot commented 3 years ago

We really need it

yonaskolb commented 3 years ago

Support for this has been added in https://github.com/yonaskolb/SwagGen/pull/259 and the just released 4.4.0