{"record":{"id":"a6f5a465126ed67b","repo":"floci-io/floci","slug":"invalid-awstime","errorCode":null,"errorMessage":"Invalid AWSTime: {}","messagePattern":"Invalid AWSTime: (.+?)","errorType":"validation","errorClass":"CoercingParseValueException","httpStatus":null,"severity":"error","filePath":"src/main/java/io/github/hectorvent/floci/services/appsync/graphql/scalars/AppSyncScalars.java","lineNumber":125,"sourceCode":"            }\n        })\n        .build();\n\n    public static final GraphQLScalarType AWS_TIME = GraphQLScalarType.newScalar()\n        .name(\"AWSTime\")\n        .description(\"An ISO-8601 time string (HH:mm:ss)\") \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                    LocalTime.parse(str, DateTimeFormatter.ISO_LOCAL_TIME);\n                } catch (DateTimeParseException e) {\n                    throw new CoercingParseValueException(\"Invalid AWSTime: \" + str);\n                }\n                return str;\n            }\n            @Override\n            public String parseLiteral(Object input) {\n                if (!(input instanceof StringValue sv)) return null;\n                return parseValue(sv.getValue());\n            }\n        })\n        .build();\n\n    public static final GraphQLScalarType AWS_TIMESTAMP = GraphQLScalarType.newScalar()\n        .name(\"AWSTimestamp\")\n        .description(\"Unix epoch seconds (0 to 32503680000)\")\n        .coercing(new Coercing<Long, Long>() {\n            @Override\n            public Long serialize(Object dataFetcherResult) {\n                if (dataFetcherResult == null) return null;","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/floci-io/floci/blob/62ff490619e7bd3554597c28c704081b4c15add5/src/main/java/io/github/hectorvent/floci/services/appsync/graphql/scalars/AppSyncScalars.java#L107-L143","documentation":"Thrown by the AWSTime scalar's parseValue when the string is not a valid ISO-8601 local time. The coercion uses LocalTime.parse with DateTimeFormatter.ISO_LOCAL_TIME, accepting HH:mm:ss with optional fractional seconds (e.g. 12:34:56 or 12:34:56.789) but rejecting offsets, am/pm markers, or missing seconds in some shapes.","triggerScenarios":"A GraphQL request sends \"10:30 AM\", \"10:30:00+02:00\" (offset not allowed; that is a different AWS extended time shape), \"25:99:00\", or \"10.30.00\" as an AWSTime variable.","commonSituations":"Frontend time pickers emitting locale strings like \"3:05 PM\"; carrying a timezone offset into a field typed AWSTime; 12-hour clock formatting from SimpleDateFormat (\"hh:mm a\"); dropping the seconds component inconsistently.","solutions":["Format with LocalTime.toString() or DateTimeFormatter.ISO_LOCAL_TIME","Strip any timezone offset before sending — convert the zoned time to a LocalTime in the intended zone","Use 24-hour clock, zero-padded HH:mm:ss","Validate client-side: try { LocalTime.parse(s); } catch before sending"],"exampleFix":"// before\nString t = new SimpleDateFormat(\"hh:mm a\").format(date); // 10:30 AM -> throws\n\n// after\nString t = LocalTime.of(10, 30, 0).toString(); // 10:30:00","handlingStrategy":"validation","validationCode":"static boolean validAwsTime(String s) { try { LocalTime.parse(s); return true; } catch (DateTimeParseException e) { return false; } }\nif (!validAwsTime(t)) throw new IllegalArgumentException(\"AWSTime must be HH:mm:ss (ISO-8601 local time)\");","typeGuard":"// TS\nconst isAwsTime = (s: string): boolean => /^\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$/.test(s);","tryCatchPattern":"catch (CoercingParseValueException e) { // flag the time input, require 24h HH:mm:ss }","preventionTips":["Use LocalTime.toString() or ISO_LOCAL_TIME","Convert zoned times to LocalTime in the target zone first","Never include offsets or am/pm markers","Normalize time-picker output before submit"],"tags":["graphql","appsync","awstime","iso-8601","time","validation"],"backgroundTag":null,"analyzedSha":"62ff490619e7bd3554597c28c704081b4c15add5","analyzedAt":"2026-08-14T14:25:23.764Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}