[SOLVED] Swagger Date-Time Bug

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [X] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

While generating a C# client from a cms content swagger, I found out that my objcets properties “created” and “lastModified” have been translated in double type object and not into DateTime.
I checked also the Swagger source file and those property are actually described as type=number and format=date-time. I think this is wrong, those properties should have type equal to string and not to number.
Here a snippet of my swagger.json configuration file:

"OrganizerContentDto": {
  "type": "object",
  "required": [
    "id",
    "data",
    "version",
    "created",
    "createdBy",
    "lastModified",
    "lastModifiedBy"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "The id of the organizer content.",
      "format": "guid"
    },
    "data": {
      "description": "The data of the organizer.",
      "$ref": "#/definitions/OrganizerDto"
    },
    "dataDraft": {
      "description": "The draft data of the organizer.",
      "$ref": "#/definitions/OrganizerDto"
    },
    "version": {
      "type": "number",
      "description": "The version of the organizer."
    },
    "created": {
      "type": "number",
      "description": "The date and time when the organizer content has been created.",
      "format": "date-time"
    },
    "createdBy": {
      "type": "string",
      "description": "The user that has created the organizer content."
    },
    "lastModified": {
      "type": "number",
      "description": "The date and time when the organizer content has been modified last.",
      "format": "date-time"
    },
    "lastModifiedBy": {
      "type": "string",
      "description": "The user that has updated the organizer content last."
    }
  }
},

Expected behavior

The Date properties of an object should be descrided in the swagger.json as shown below:

"lastModified": {
  "type": "string",
  "description": "The date and time when the organizer content has been modified last.",
  "format": "date-time"
}

Environment

  • [ ] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [X] Cloud version

Thanks, I have fixed, but not deployed it yet.

I have deployed the fix.