push_pin
lock
SelectionEntity.MemberCount data type inconsistency
Hi, In the Swagger file of the Agents Web API, the "MemberCount" property, that belongs to "SuperOffice.CRM.Services.SelectionEntity", is defined like this: "MemberCount": { "format": "int32", "description": "How many selectionmembers (for progress bar calculations) - estimate, -1 (or 4294967295) means we don't know", "type": "integer" } 4294967295 is the max value for an unsigned integer. Obviously, -1 cannot be assigned to an unsigned integer, so there is some inconsistency regarding the intended data type here. In package SuperOffice.NetServer.Services.10.2.9.778, SelectionEntity.MemberCount is declared as an unsigned integer: // // Summary: // How many selectionmembers (for progress bar calculations) - estimate, -1 (or // 4294967295) means we don't know [DataMember] public virtual uint MemberCount { get; set; } And indeed, when we make a REST call to the Web API, we receive UInt32.MaxValue as the MemberCount for selections with an unknown number of members: ... "IncludePerson": 0, "MemberCount": 4294967295, "Name": "DataBridge 20170705143636 new person", ... The client we generate using OpenAPI Generator declares SelectionEntity.MemberCount as an int, so it crashes when it tries to deserialize a selection with an unknown member count. JSON integer 4294967295 is too large or small for an Int32. Path 'MemberCount', line 1, position 973. The only way to get OpenAPI Generator to declare MemberCount as a uint is to add a flag --openapi-normalizer ADD_UNSIGNED_TO_INTEGER_WITH_INVALID_MAX_VALUE=true and change the Swagger file as follows: "MemberCount": { "format": "int32", "description": "How many selectionmembers (for progress bar calculations) - estimate, -1 (or 4294967295) means we don't know", "type": "integer", "minimum": 0, "maximum": 4294967295 } Can you let us know if you are able to automatically add the minimum and maximum fields in the Swagger file? We would like to avoid having to change the Swagger file manually as much as possible. Thank you