Alpaca provides the easiest way to generate interactive HTML5 forms for web and mobile applications. It uses JSON Schema and simple Handlebars templates to generate great looking, dynamic user interfaces on top of Twitter Bootstrap, jQuery UI, jQuery Mobile and HTML5.
If a schema has type: ["string", "null"] or type: ["null", "integer"], etc., this change will just use the first non-null type from the array.
UPDATE: I just found some other cases where this needs to be handled: I wasn't able to update the value for any optional drop-down select lists (ListField). There might be a few other places with lines of code similar to this:
if (!self.schema.type || self.schema.type === "string")
Fixes #292
If a schema has
type: ["string", "null"]
ortype: ["null", "integer"]
, etc., this change will just use the first non-null type from the array.UPDATE: I just found some other cases where this needs to be handled: I wasn't able to update the value for any optional drop-down select lists (ListField). There might be a few other places with lines of code similar to this:
These will need to be updated to something like:
(But probably less verbose!)
Maybe there could be a generic "schema type checker" function that checks for any | null.