OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
[ ] Have you provided a full/minimal spec to reproduce the issue?
[ ] Have you validated the input using an OpenAPI validator (example)?
[x] What's the version of OpenAPI Generator used?
[x] Have you search for related issues/PRs?
[x] What's the actual output vs expected output?
[ ] [Optional] Bounty to sponsor the fix (example)
Description
Attempting to generate C# models for the Bungie API, using their openapi spec. Once generated and I deserialize the JSON, I get the following error: JSON integer 3612906877 is too large or small for an Int32
Upon investigation, the openapi file defines seasonHashes as
Note the uint32. The generated code however, defines SeasonHashes as int, which is a smaller range of values, which does not fit the value coming from the API
Bug Report Checklist
Description
Attempting to generate C# models for the Bungie API, using their openapi spec. Once generated and I deserialize the JSON, I get the following error:
JSON integer 3612906877 is too large or small for an Int32
Upon investigation, the openapi file defines
seasonHashes
asNote the
uint32
. The generated code however, definesSeasonHashes
asint
, which is a smaller range of values, which does not fit the value coming from the APIIf I manually change, in the generated C# code, these types to
long
s, everything works.It appears the generator incorrectly generates
uint32
types asint
.openapi-generator version
4.3.0
OpenAPI declaration file content or url
https://raw.githubusercontent.com/Bungie-net/api/master/openapi-2.json
Command line used for generation
openapi-generator generate -i https://raw.githubusercontent.com/Bungie-net/api/master/openapi-2.json -g csharp-netcore -o ./csharp-netcore --skip-validate-spec -c ./config.json
Steps to reproduce
Related issues/PRs
Suggest a fix