{"record":{"id":"3b2fad7616048cc0","repo":"floci-io/floci","slug":"invalid-awsbigint","errorCode":null,"errorMessage":"Invalid AWSBigInt: {}","messagePattern":"Invalid AWSBigInt: (.+?)","errorType":"validation","errorClass":"CoercingParseValueException","httpStatus":null,"severity":"error","filePath":"src/main/java/io/github/hectorvent/floci/services/appsync/graphql/scalars/AppSyncScalars.java","lineNumber":430,"sourceCode":"            }\n        })\n        .build();\n\n    public static final GraphQLScalarType AWS_BIG_INT = GraphQLScalarType.newScalar()\n        .name(\"AWSBigInt\")\n        .description(\"An arbitrary-precision integer\")\n        .coercing(new Coercing<String, String>() {\n            @Override\n            public String serialize(Object dataFetcherResult) {\n                return dataFetcherResult != null ? dataFetcherResult.toString() : null;\n            }\n            @Override\n            public String parseValue(Object input) {\n                String str = input.toString();\n                try {\n                    new BigInteger(str);\n                } catch (NumberFormatException e) {\n                    throw new CoercingParseValueException(\"Invalid AWSBigInt: \" + str);\n                }\n                return str;\n            }\n            @Override\n            public String parseLiteral(Object input) {\n                if (input instanceof graphql.language.IntValue iv) return iv.getValue().toString();\n                if (input instanceof StringValue sv) return parseValue(sv.getValue());\n                return null;\n            }\n        })\n        .build();\n\n    public static final GraphQLScalarType AWS_BYTE = GraphQLScalarType.newScalar()\n        .name(\"AWSByte\")\n        .description(\"A base64-encoded byte array\")\n        .coercing(new Coercing<String, String>() {\n            @Override\n            public String serialize(Object dataFetcherResult) {","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/floci-io/floci/blob/62ff490619e7bd3554597c28c704081b4c15add5/src/main/java/io/github/hectorvent/floci/services/appsync/graphql/scalars/AppSyncScalars.java#L412-L448","documentation":"Thrown by the AWSBigInt scalar's parseValue when the string cannot construct a java.math.BigInteger. The scalar travels as a string on the wire, and the text must be a plain integer literal: optional sign followed by digits, with no decimal point, separators, or whitespace.","triggerScenarios":"A GraphQL request sends \"12345678901234567890.0\" (decimal point), \"1_000_000\" (underscores), \" 42\" (leading space), or \"abc\" as a variable for a field typed AWSBigInt.","commonSituations":"Serializing a BigDecimal/double instead of a BigInteger (trailing \".0\"); language literals with underscore separators (Java/Rust style) leaking into payloads; whitespace from user input or file parsing; passing hex/octal text like \"0x1F\".","solutions":["Convert to integer type before serializing: bd.toBigInteger().toString(), never bd.toString() when the source is decimal","Strip whitespace and reject non-digit input client-side with your own validation","Do not use underscore or 0x-prefixed literals in the string","Validate client-side: try { new BigInteger(s); } catch before sending"],"exampleFix":"// before\nString id = bigDecimalSource.toString(); // \"12345678901.0\" -> throws\n\n// after\nString id = bigDecimalSource.toBigInteger().toString(); // \"12345678901\"","handlingStrategy":"validation","validationCode":"static String toAwsBigInt(java.math.BigInteger bi) { return bi.toString(); }\nstatic boolean validAwsBigInt(String s) { try { new java.math.BigInteger(s); return true; } catch (NumberFormatException e) { return false; } }","typeGuard":"const isAwsBigInt = (s: string): boolean => /^-?\\d+$/.test(s.trim());","tryCatchPattern":"catch (CoercingParseValueException e) { // re-serialize from the integer type (toBigInteger) and resend }","preventionTips":["Serialize from BigInteger, never BigDecimal/double (no trailing .0)","Strip whitespace and reject underscores/0x prefixes","Validate with new BigInteger(s) before sending"],"tags":["graphql","appsync","awsbigint","bignum","validation"],"backgroundTag":null,"analyzedSha":"62ff490619e7bd3554597c28c704081b4c15add5","analyzedAt":"2026-08-14T14:25:23.764Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}