OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
I hope it's OK I'm reporting all the issues I've found this way. It is my knowledge that non of them has been previously reported. Tested them all with OpenAPI 2.
Framework: C# NancyFx
Problem: When returning 204 http status code, it explicitly returns an empty Content-Type header instead of not putting one at all, and returns 200 instead.
Severity: The empty Content-Type on 204 causes the c++ restsdk client to throw an exception because of this.
Temporary workaround: find "autogen_path" -iname "*.cs" | xargs -I {} sed -i 's/return new Response { ContentType = ""};/return new Response { ContentType = null, StatusCode = HttpStatusCode.NoContent };/g' {}
Framework: C# NancyFx
Problem: When defining a property as an integer data type limited by specific enums, instead of returning the enum value, it returns it's enum index which is nonsense.
Severity: Can't define enums for integer types.
Temporary workaround: Defining and registering a custom NancyFx JavaScriptPrimitiveConverter which goes around it.
Framework: C# NancyFx
Problem: Returning a binary string ("application/octet-stream") defines an C# Stream as the result, but NancyFx does not know how to handle it and borks with an error.
Severity: Can't return binary data.
Temporary workaround: Defining an custom NancyFx IResponseProcessor for application/octet-stream which streams the returned Stream.
Framework: C# NancyFx
Problem: No automatic way to handle multiple produces.
Severity: Can't use multiple produces.
Temporary workaround: You can override the routing code for a specific endpoint and make it call different functions per provides.
Framework: C++ REST SDK
Problem: When receiving a binary string, HttpContent isn't allocated and the program crashes, also the header file points to the wrong location in the Model directory.
Severity: Can't receive binary strings, also runtime crash.
Temporary workaround:
Framework: C++ REST SDK
Problem: When an property is defined as a double number, and has no decimal dot in the data, the generation ignores the value.
Severity: Can't accept double numbers without dots.
Temporary workaround: Fix bool ModelBase::fromJson( const web::json::value& val, double & outVal ) and bool ModelBase::fromJson( const web::json::value& val, float & outVal )
Framework: C++ REST SDK
Problem: Instead of reusing the base http connection between requests, it creates a new one per function call.
Severity: Performence penalty, each function call sets up a new connection, no http keep-alive.
Temporary workaround: ?
Framework: C++ REST SDK
Problem: Cannot define model names to start with a number (in some others you can, and they are renamed on the fly).
Severity: ?
Temporary workaround: Don't put a number in the start of the model name.
Framework: C++ REST SDK
Problem: The CMake library for the auto generated model / api header files marks them as private and require manual adding them to parent project.
Severity: ?
Temporary workaround: Manually include the required header files.
Framework: C# NancyFx Problem: Sometimes added ghost "using ;" to Modules files. Severity: Code does not compile. Temporary solution: bash find "autogen_path" -iname "*.cs" | xargs -I {} sed -i "s/using ;//g" {}
I hope it's OK I'm reporting all the issues I've found this way. It is my knowledge that non of them has been previously reported. Tested them all with OpenAPI 2.
Framework: C# NancyFx
Problem: When returning 204 http status code, it explicitly returns an empty Content-Type header instead of not putting one at all, and returns 200 instead.
Severity: The empty Content-Type on 204 causes the c++ restsdk client to throw an exception because of this.
Temporary workaround:
find "autogen_path" -iname "*.cs" | xargs -I {} sed -i 's/return new Response { ContentType = ""};/return new Response { ContentType = null, StatusCode = HttpStatusCode.NoContent };/g' {}
Framework: C# NancyFx
Problem: When defining a property as an integer data type limited by specific enums, instead of returning the enum value, it returns it's enum index which is nonsense.
Severity: Can't define enums for integer types.
Temporary workaround: Defining and registering a custom NancyFx JavaScriptPrimitiveConverter which goes around it.
Framework: C# NancyFx
Problem: Returning a binary string ("application/octet-stream") defines an C# Stream as the result, but NancyFx does not know how to handle it and borks with an error.
Severity: Can't return binary data.
Temporary workaround: Defining an custom NancyFx IResponseProcessor for application/octet-stream which streams the returned Stream.
Framework: C# NancyFx
Problem: No automatic way to handle multiple produces.
Severity: Can't use multiple produces.
Temporary workaround: You can override the routing code for a specific endpoint and make it call different functions per provides.
Framework: C++ REST SDK
Problem: When receiving a binary string, HttpContent isn't allocated and the program crashes, also the header file points to the wrong location in the Model directory.
Severity: Can't receive binary strings, also runtime crash.
Temporary workaround:
Framework: C++ REST SDK
Problem: When an property is defined as a double number, and has no decimal dot in the data, the generation ignores the value.
Severity: Can't accept double numbers without dots.
Temporary workaround: Fix
bool ModelBase::fromJson( const web::json::value& val, double & outVal )
andbool ModelBase::fromJson( const web::json::value& val, float & outVal )
Framework: C++ REST SDK
Problem: Instead of reusing the base http connection between requests, it creates a new one per function call.
Severity: Performence penalty, each function call sets up a new connection, no http keep-alive.
Temporary workaround: ?
Framework: C++ REST SDK
Problem: Cannot define model names to start with a number (in some others you can, and they are renamed on the fly).
Severity: ?
Temporary workaround: Don't put a number in the start of the model name.
Framework: C++ REST SDK
Problem: The CMake library for the auto generated model / api header files marks them as private and require manual adding them to parent project. Severity: ?
Temporary workaround: Manually include the required header files.
Framework: C# NancyFxProblem: Sometimes added ghost "using ;" to Modules files.Severity: Code does not compile.Temporary solution:bash find "autogen_path" -iname "*.cs" | xargs -I {} sed -i "s/using ;//g" {}