play-swagger icon indicating copy to clipboard operation
play-swagger copied to clipboard

Custom mapping joda DateTime error

Open contact-mymoneytime opened this issue 8 years ago • 3 comments

Default mapping of or.joda.time.DateTime is

{
    type: "integer",
    format: "epoch"
}

Overriding this binding with swagger-custom-mappings.yml doesn't work. Here is the yml:

- type: org\.joda\.time\.DateTime
  specAsParameter:
      - type: string
        format: date-time

contact-mymoneytime avatar Dec 14 '16 16:12 contact-mymoneytime

This is working for me, although I have a slightly different swagger-custom-mappings.yml file:

---
  - type: .*DateTime
    specAsParameter:
      - type: string
        format: date-time

This produces the following output fragment as expected:

"dueDate": {
"type": "string",
"format": "date-time"
}

kbedel avatar Jan 09 '17 16:01 kbedel

Can confirm org.joda.time.DateTime does not work but .*DateTime does

longliveenduro avatar Mar 23 '18 16:03 longliveenduro

@contact-mymoneytime Try this one:

---
- type: "org.joda.time.DateTime"
  specAsParameter:
    - type: string
      format: date-time

alexander-myltsev avatar Jan 13 '20 04:01 alexander-myltsev