hapijs / hapi

The Simple, Secure Framework Developers Trust
https://hapi.dev
Other
14.63k stars 1.34k forks source link

DateAndList datatype doesn't support datetimestamp without milisec with zoneID(2015-02-07T13:28:17+00:00) #4514

Closed AjeetYadav07 closed 4 months ago

AjeetYadav07 commented 4 months ago

Runtime

JAVA

Runtime version

v21

Module version

v20.3.0

Used with

hapi application

Any other relevant information

Sending 2015-02-07T13:28:17+00:00(when not including milisec) for the last_updated parameter in our questionnaire API (using hapi library DateAndList type) might cause hapi to return an error. It seems DateAndList might not expect time zones without milisecond.

{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "processing", "diagnostics": "HAPI-1883: Invalid date/time format: \"2015-02-07T13:28:17 00:00\": Expected character '.' at index 19 but found " } ] }

The API seems to accept timestamps with zone offsets, including milliseconds, in the last_updated parameter.

For example, if you send a query like 2015-02-07T13:28:17.000+00:00 (including milliseconds and a time zone offset of +00:00), the API parses it successfully and potentially returns a response for that specific date and time.

How can we help?

const some = 'properly formatted code example';
kanongil commented 4 months ago

This repo concerns the Hapi.js http server, and has no relation to HAPI FHIR, which your report seems to relate to.