aries-cloudagent-python icon indicating copy to clipboard operation
aries-cloudagent-python copied to clipboard

fields.Int generates `int32` in swagger, but some fields are larger than int32

Open TimoGlastra opened this issue 4 years ago • 1 comments

Integers in schemas are marked as Fields.Int in ACA-Py. The swagger UI generated automatically marks this as an int32, which is not sufficient for some numbers ACA-Py uses (mostly time based related to TAA and Revocation). This is an example of the swagger ACA-Py generated:

{
    "from": {
        "description": "Earliest time of interest in non-revocation interval",
        "example": 1640995199, 
        "format": "int32",
        "maximum": 18446744073709551615,
        "minimum": 0, 
        "type": "integer"
    }
}

The maximum value here will overflow for int32. This is at least happening in the following schemas:

  • IndyProofRequestNonRevokedSchema
  • IndyProofReqPredSpecNonRevokedSchema
  • IndyProofReqAttrSpecNonRevokedSchema
  • TAAAcceptanceSchema

This makes it harder to generate clients for this as it will overflow and makes the max -1 and the min 0. So you can never input a valid number anymore.

Not so sure what the fix is yet

TimoGlastra avatar Nov 10 '21 14:11 TimoGlastra

@shaangill025 -- could you please see if this can be fixed?

swcurran avatar Jun 03 '22 22:06 swcurran