raml-org/raml-java-parser

datetime-only validation

juanchib opened this issue · 1 comments

#%RAML 1.0
title: test API
version: v1.0

/dateTimeOnlyValidation:
  post:
    description: validate dateTimeOnly type with border date values
    body:
      application/json:
        type: datetime-only 
        example: 2014-02-238T16:41:41.00 

Validation for the example should throw an error. At 1.0.30 it works as expected but on later versions it doesn't throw any exception.

The problem seems to be related to joda-time, which parses our dates. When we split out the year to allow for some flexibility, the parsed joda date format string seems to accept three digit dates.

In the fix for #652, I address this problem.