Jump to content
Sign in to follow this  
justin nelson

How can I differentiate between a 'date string' and a 'string'?

Recommended Posts

Dates are passed a string values, and they look exactly like strings to my schema parser.

"StoryId": {
    "type": "integer",
    "description": "The unique identifier for a news story",
    "demoValue": 12654,
    "minimum": 1,
    "maximum": 2147483647
  },
 "Headline": {
    "type": "string",
    "description": "The News story headline",
    "demoValue": "Barron's(8/29) Speaking Of Dividends: The Big Cheese: Kraft Foods Slices Costs And Serves A Payout Hike"
  },
"PublishDate": {
    "type": "string",
    "description": "The date on which the news story was published. Always in UTC",
    "demoValue": "/Date(1289231327280)/"
  }

Which one of the above should be formatted as a date? (I could scrape descriptions or value names, but that feels dirty.)

Would it make sense to use a ‘date’ type?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×