From 0fe331d5a757900ba8ee1bb29229b9f9bdfba37b Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 23 Sep 2014 18:18:41 -0400 Subject: [PATCH] Documentation polishing. --- microjson.asc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/microjson.asc b/microjson.asc index a400cf3..df67faf 100644 --- a/microjson.asc +++ b/microjson.asc @@ -157,13 +157,17 @@ when the JSON object does not contain the corresponding attribute. You can turn off this defaulting behavior by setting the +nodefault+ member to +true+. -Additionally, an +json_attr_t+ instance with a +t_integer+ or -+t_uinteger+ type field can point at a map (an array of +json_enum_t+ -structures) that lists names and pairs of integral values. If this is -done, the parser expects the values of the JSON attribute to be strings but -internally maps them to corresponding integer values beore setting the -target storage. An un-enumerated string value causes the parse to -error out. +=== Enumerated-value types === + +The parser includes support for string attributes with controlled +vocabularies. + +A +json_attr_t+ instance with a +t_integer+ or +t_uinteger+ type field +can point at a map (an array of +json_enum_t+ structures) that lists +names and pairs of integral values. If this is done, the parser +expects the values of the JSON attribute to be strings but internally +maps them to corresponding integer values before setting the target +storage. An un-enumerated string value causes the parse to error out. (Case 8 in the unit tet source code illistrates how to use this feature.) -- 2.43.0