Open bsolovij-ebsco opened 3 years ago
As the comment suggests, this is on purpose. You have to provide the implementation, so it's no use having it be uncommented.
If you'd like to automatically generate stub requests a good place to start would be the aspnetcore server generator that can generate stub serverside methods. However those are also semi-broken for some schemas.
If you want to add this you'd have to add an additional property that conditionally enables stub-tests. Feel free to open a pull request. See CONTRIBUTING.md in the root folder of this project.
Description
After generating a Client library for a given api, the Unit Test Project that is generated contains test assertions which are commented out and comments in the generated code reading
// TODO uncomment below to test the method and replace null with proper value
Generated code example portion relevant:
openapi-generator version
@openapitools/openapi-generator-cli@2.4.4
OpenAPI declaration file content or url
n/a - any csharp generator resulting Test Project will suffice
Command line used for generation
due to the CI environment, the call line is a little hairy, thanks for understanding
Steps to reproduce
just generate a csharp project set
Suggest a fix/enhancement
It may be im missing a configuration flag - please tell me! 🤣
If im not missing something in the configuration string : a simple fix would be to use the openapi json file's
schema
section to type matching to create stub results. If this is not something the currentcsharp
generator does - could someone point me to where i could offer to add this via PRLove this tool - thanks in advance!