Ensure original declaration order for JSON string enums (#47)
The Hashtbl that keeps the items of an enumeration also keeps the original index of each item. We can address #47 by using that index to recreate the original ordering.
This helps in making JSON schemas more stable. Normally, JSON schemas for enums would be shuffled around when a single new item is added. The new behaviour retains the original ordering - meaning if one adds a new item to the end of the list of enum items, it will also appear at the end in the JSON schema.
Edited by Ole Krüger