Skip to content

Make use of format to infer type of generated fields #26

Open
@HaukeRa

Description

@HaukeRa

The generator only uses the type field to determine the type of the generated field in a class.

For example this property:

    "createdAt": {
      "type": "string",
      "description": "The timestamp in milliseconds when the account was created.",
      "format": "int64"
    }

will generate the field val createdAt:String despite the format giving the hint, that it should actually be interpreted as an integer. The same issue arises when a field is declared with "type":"number" while having "format":"int64". The generated classes use BigDecimal in this case, while a Long would be way more convenient and can be ensured to work due to the format.

Note: int64 can be replaced with int32 without changing the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions