api-documentation icon indicating copy to clipboard operation
api-documentation copied to clipboard

Add user-input to json

Open aleene opened this issue 9 years ago • 7 comments

As I understand it, now most fields have een parsed by product opener. This implies that capitalization and special characters have been removed. This process is irreversible. And we lost what the user tried to input. It would be nice to have the original input (add _orig to field as with the producer codes), so a nicer output can be presented to the user.

aleene avatar May 10 '16 11:05 aleene

Which fields? For most tag fields, e.g. brands, "brands" contains the original input from the last user. brands_tags contain the canonicalized tags.

For taxonomized fields (e.g. categories), categories_hierarchy keeps accents and capitalization unless the tag exist in the taxonomy.

stephanegigandet avatar May 10 '16 11:05 stephanegigandet

Very good point. I noticed in the JSON, that only the producer code has an original variant. So I thought, useful, why not the other fields? And the Brand-field comes to mind. It needs either taxonomy support, or I like to see the original field. Now the user input is really mangled.

aleene avatar May 10 '16 16:05 aleene

The "emb_codes_orig" field is now a single string with all the doce. It should be an array of string.

aleene avatar May 11 '16 09:05 aleene

emb_codes_orig is used because there is a special normalization for packaging codes, beyond deaccentuation / decapitalization and taxonomization.

emb_codes_orig is used to save the exact user input (before the special normalization) so that we can put it back in the input field when users edit products. It is not intended for other purposes.

For the brands, you have the exact user input in the "brands" field. brands_tags contain the tag values.

So for all fields, the original user input is in the JSON, nothing has been lost.

stephanegigandet avatar May 12 '16 10:05 stephanegigandet

That was the reason why I wanted the originals.

OK, I will use brands until there is a taxonomy, which can be used.

What about the packaging field? Is there an original?

aleene avatar May 12 '16 11:05 aleene

For all fields, the original user input is in the non suffixed field. e.g. "packaging":"Carton,sachet,plastique,PAP 21,HDPE 02,HDPE,Polietileno de alta densidade,Cartão"

stephanegigandet avatar May 12 '16 11:05 stephanegigandet

Add this info to the API documentation.

aleene avatar May 12 '16 13:05 aleene