Something went wrong while setting issue due date.
[BUG] [csharp-netcore] Don't check integers if they are null
Closed
[BUG] [csharp-netcore] Don't check integers if they are null
Created by: tndata
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- What's the version of OpenAPI Generator used?
- Have you search for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Bounty to sponsor the fix (example)
Description
The generation works fine, but I get warnings by the compiler in Visual Studio due to code like this:
public Org.OpenAPITools.Client.ApiResponse< CustomerExternalServicesModelCollection > GetCustomerExternalServicesWithHttpInfo (int customerId) { // verify the required parameter 'customerId' is set if (customerId == null) throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'customerId' when calling CustomerExternalServicesApi->GetCustomerExternalServices");
.....
openapi-generator version
4.2.1
OpenAPI declaration file content or url
https://leksaker.starweb.se/api/v2/openapi.json
Command line used for generation
npx openapi-generator generate -i https://leksaker.starweb.se/api/v2/openapi.json -g csharp-netcore -o /temp/swagger
Suggest a fix
Don't include null-checks against integer input parameters.