Open Closed

The JSON value could not be converted to System.Decimal. Path: $.nelAmount | LineNumber: 0 | BytePositionInLine: 101. #4343


User avatar
0
mmukkara created

The issue is when we send data (POST) from Angular front end to Back end API with Datatype Decimal. If the number is 3 digits (123.00) it works fine. if its more than 4 digits (1234.00), it throws below error.

  • ABP Framework version: v6.0.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • { "code": null, "message": "Your request is not valid!", "details": "The following errors were detected during validation.\r\n - The JSON value could not be converted to System.Decimal. Path: $.nelAmount | LineNumber: 0 | BytePositionInLine: 101.\r\n", "data": {}, "validationErrors": [ { "message": "The JSON value could not be converted to System.Decimal. Path: $.nelAmount | LineNumber: 0 | BytePositionInLine: 101.", "members": [ "$.nelAmount" ] } ] }

2023-01-12 13:54:35.983 -05:00 [WRN] ModelState is not valid! See ValidationErrors for details. Volo.Abp.Validation.AbpValidationException: ModelState is not valid! See ValidationErrors for details. at Volo.Abp.AspNetCore.Mvc.Validation.ModelStateValidator.Validate(ModelStateDictionary modelState) at Volo.Abp.AspNetCore.Mvc.Validation.AbpValidationActionFilter.OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) 2023-01-12 13:54:35.985 -05:00 [WRN] There are 1 validation errors: The JSON value could not be converted to System.Decimal. Path: $.nelAmount | LineNumber: 0 | BytePositionInLine: 101. ($.nelAmount)

  • Steps to reproduce the issue: Sending more that 3 digits from Angular Application to bank end System.Decimal datatype field.

payload

error {"error":{"code":null,"message":"Your request is not valid!","details":"The following errors were detected during validation.\r\n - The JSON value could not be converted to System.Decimal. Path: $.nelAmount | LineNumber: 0 | BytePositionInLine: 101.\r\n","data":{},"validationErrors":[{"message":"The JSON value could not be converted to System.Decimal. Path: $.nelAmount | LineNumber: 0 | BytePositionInLine: 101.","members":["$.nelAmount"]}]}}

header


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I see the question has bee closed. Did you resolve the problem?

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09