-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Imagine the following example:
var paperwork = require('paperwork');
var ScenarioSchemaPatch = {
title: paperwork.optional(String),
text: paperwork.optional(String)
};
var post = { text : "data", unknown_field : "foo"};
paperwork(ScenarioSchemaPatch, post, function (err, validated) {
if (err) {
console.error("Error",err);
} else {
console.log("JSON", validated);
}
});
It returns:
JSON { title: null, text: 'data' }
Why is the title set to null, even if it was set to optional?
Metadata
Metadata
Assignees
Labels
No labels