This takes the json2code perl script from the osv and pass it with small
adaptation.
It takes a swagger definition file and creates a hh file from it with
the following code support.
Api opperations are translated to path_description with a name that
determine by their nick name.
Moduls are defined as json object with the same name.
Enums are defined as enum class, a string to enum function is defined
for any query enum parameters.
For enums that are part of a json object a conversion function is
defined so enum of a different type can be assigned to the target enum
as long as it has the same enum values.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This is a migration of the basic json support taken from the
osv/httpserver.
The routes uses the json object to return errors in a json format.
This also adds json_exception which has a constructor from an exception.
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>