-
Couldn't load subscription status.
- Fork 8
Description
Feature Description
Working with the CRUD Service, we noticed that all the values included in request body are casted to the relative type, accordingly to the JSON Schema definition, but this works only on first-level fields.
As example, taking into account the books collection definition, the publishDate property have type Date because I want it to be transformed from a string to an ISODate. The same doesn't happen from the property date inside editionDates, which is a { type: "string", format: "date-time" } but it is located inside an array, and any POST/PUT/PATCH operation will save the value as a regular string (or whatever it is included in the request body).
Desired solution
The function QueryParser.traverseBody is used to transform values of every field defined in the JSON Schema definition.
It would be great if the method would be recursive, and operates inside objects and arrays.
The property fieldDefinition already contains the definitions also for nested types (after #252), so that part is already done.
Possible alternatives
Unfortunately there are no alternative for this issue, other than having these fields at root level. If a property must be included into an array, however, the problem persist.