Forum Discussion

jacksonn123's avatar
jacksonn123
New Contributor
6 years ago

Timestamp Unix epoch problem

This is correct ?

How i can pass this parameter string (01/08/2018 00:00:00) to recive (1552562340) in query string

        - name: timestamp
          in: query
          required: true
          description: Tempo formato Unix epoch
          #1552562340 (01/08/2018 00:00:00 GMT)
          schema:
            type: string
            format: unix-timestamp
        - name: signature
          in: query

1 Reply

  • There's no defined way to describe epoch in the spec. At the moment, there's only one way to describe a timestamp.

     

    You can use the 'format' field with whichever value, as it's an open field. Just keep in mind tooling will not automatically know what it means. Some tools may offer extensibility to support custom formats.

     

    In OpenAPI 3, there's a process of building a registry of additional formats. You can find more information about it here.