Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Http server: Code generation extended enum support
When a return member will be declare as an enum string, a local enum will be decalre for it with the proper values. A wrapper class for that enum will be used as the return type, so the enum values will be replaced by their string representation. The wrapper class also support auto enum conversion based on enum values as long as the origin enum will have all the declared values. For example: In a swagger json definition file the following entry was added to model Thread: "status": { "type": "string", "description": "thread status", "enum": [ "invalid", "prestarted"] } In the code we have another enum class defined as: enum class my_status {invalide, prestarted} The created Thread class will have a member called status and a enum class Thread_status. if we'll declare value of my_status: my_status status = my_status::invalid; We can use it to set the value of: T t; t.status = status; Signed-off-by: Amnon Heiman <[email protected]> Signed-off-by: Pekka Enberg <[email protected]>
- Loading branch information