You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GraphQL service exception for 'POST /graphql/UnknownOperation - 4a22f1afa6b4662d460ab8929d3c10f6': '0x00' is an invalid end of a number. Expected a delimiter. LineNumber: 0 | BytePositionInLine: 2.
System.Text.Json.JsonReaderException: '0x00' is an invalid end of a number. Expected a delimiter. LineNumber: 0 | BytePositionInLine: 2.
at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes)
at System.Text.Json.Utf8JsonReader.TryGetNumber(ReadOnlySpan`1 data, Int32& consumed)
at System.Text.Json.Utf8JsonReader.ReadFirstToken(Byte first)
at System.Text.Json.Utf8JsonReader.ReadSingleSegment()
at System.Text.Json.Utf8JsonReader.Read()
at System.Text.Json.JsonDocument.TryParseValue(Utf8JsonReader& reader, JsonDocument& document, Boolean shouldThrow, Boolean useArrayPools)
at System.Text.Json.JsonElement.ParseValue(Utf8JsonReader& reader)
at HotChocolate.Types.JsonType.JsonFormatter.Format(IValueNode node)
at HotChocolate.Types.JsonType.ParseLiteral(IValueNode valueSyntax)
at HotChocolate.Types.InputParser.ParseLeaf(IValueNode resultValue, ILeafType type, Path path, IInputFieldInfo field)
at HotChocolate.Types.InputParser.ParseLiteralInternal(IValueNode value, IType type, Path path, Int32 stack, Boolean defaults, IInputFieldInfo field)
at HotChocolate.Types.InputParser.ParseLiteralInternal(IValueNode value, IType type, Path path, Int32 stack, Boolean defaults, IInputFieldInfo field)
at HotChocolate.Types.InputParser.ParseObject(IValueNode resultValue, InputObjectType type, Path path, Int32 stack, Boolean defaults)
at HotChocolate.Types.InputParser.ParseLiteralInternal(IValueNode value, IType type, Path path, Int32 stack, Boolean defaults, IInputFieldInfo field)
at HotChocolate.Types.InputParser.ParseLiteralInternal(IValueNode value, IType type, Path path, Int32 stack, Boolean defaults, IInputFieldInfo field)
at HotChocolate.Types.InputParser.ParseLiteral(IValueNode value, IInputFieldInfo field, Type targetType)
at HotChocolate.Execution.Processing.MiddlewareContext.CoerceArgumentValue[T](ArgumentValue argument)
at HotChocolate.Execution.Processing.MiddlewareContext.ArgumentValue[T](String name)
at DataAnnotatedModelValidations.ValidatorMiddleware.<>c__DisplayClass6_0.<ReportErrorFactory>b__0(IInputField argument)
at System.Linq.Parallel.ForAllOperator`1.ForAllEnumerator`1.MoveNext(TInput& currentElement, Int32& currentKey)
at System.Linq.Parallel.ForAllSpoolingTask`2.SpoolingWork()
at System.Linq.Parallel.SpoolingTaskBase.Work()
at System.Linq.Parallel.QueryTask.BaseWork(Object unused)
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
Additional Context?
No response
Version
13.0.5
The text was updated successfully, but these errors were encountered:
The JSON reader continues to read the underlying input buffer, even though only 2 bytes were written the underlying buffer is 512 bytes
The solution is to pass in the bytes actually written to the call to GetSpan so it only returns the relevant bytes rather than its initial buffer size.
onionhammer
changed the title
JSON scalar crashes with number literal inputsJSON scalar crashes on JsonElement inputs
Apr 5, 2023
onionhammer
added a commit
to onionhammer/graphql-platform
that referenced
this issue
Apr 5, 2023
Is there an existing issue for this?
Product
Hot Chocolate
Describe the bug
When an input is of type
JSON
, HotChocolate crashes for numeric inputs (such as10
), with the following exceptionSteps to reproduce
JsonElement
in HC13Relevant log output
Additional Context?
No response
Version
13.0.5
The text was updated successfully, but these errors were encountered: