raml-org / raml-spec

RAML Specification
http://raml.org
3.87k stars 858 forks source link

date/time types need support for a sysdate or now default value. #758

Open rspremulli-sf opened 3 years ago

rspremulli-sf commented 3 years ago

A common use case for dates on a property is to default them to whatever the current date is. A classic example of this is a property representing the creation datetime of an object. It would be defaulted to whatever the current datetime is on the system for auditing purposes. There is no way to define such a default value today however, there is no keyword that is valid for the default value facet; only a datetime is legal.

Expectation: support similar functionality to the below:

SampleType:
  properties:
    creationDate?:
      type:datetime-only
      default: now