recently I was wondering if the design of Note Templates allows for multiple templates to be assigned for a given Notefile.
My initial picture of note rejection mechanism on a templated notefile, was that more than one template can be provided in order to expand the range of possible note’ body json structures.
On the other hand, is it possible to somehow omit a whole JSON object, within a given note body?
Since, given how note structure tracks omitempty property, for what is considered a default value of a field’ subtype, this could allow a sender to work with more variety.
I can imagine specifying this property for a given JSON object either when registering a template, or just some kind of a rule across the all note.add ( body field) requests.
But, the whole purpose of templates, as I understand it, was to guide a design where each note would be relatively fixed length (or at least define an upper bound), in order to guarantee robust storage allocation.
Are the old templates accessible or applied somehow? Is the Notecard API implying that we need to erase previous templates for a given file, with note.template request where file is specified, but body left out.
Also, was ‘numerous Notefile templates (>25)’ meant for a given file at the give time, or for a given file across all time (but only one template active on that file), or for any notefiles across all time (or one time).
I’m not sure if you saw my initial reply, but I just deleted it as it was actually incorrect. To be clear, each Notefile can only be associated with one template. Now, within that one template you do have some flexibility. For example, you can create a relatively complicated body that includes all sorts of data types (including arrays), but then only include the data you need in subsequent note.add requests.
Right, but I was thinking along the line of using one notefile but change schema just-in-time preemptively before transitioning between the given three scenarios mentioned above.
But that just seems like a wasteful anti-pattern.
Yeah don’t do that! Templates are meant to be created once and only once for a given Notefile. When you create additional templates for the same Notefile, you’re effectively wasting resources by allocating additional storage unnecessarily on the Notecard.