Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Error in V13.1 calling Any API service function with an Object as a parameter #11898


User avatar
0
ayoyusuf created

Solution: Angular + Asp.Net Core Version: 13.1

Issue with the API

Issue: Everything worked fine before upgrade from Version 12.4 to Version 13.1.

If I run any endpoint that has an Object as any of its parameter, I get an error from the ASP.Net zero framework before it even gets to the end point.

I even tried it right from swagger, and it triggers the error before it gets to the endpoint. If all parameters are string or anything else, they all work fine. the Error is below:

the sample end point in the App service

public async Task<object> RunDefinedReportObjectAsync(string reportName, object selectedparameters, object paramtype = null)

Error MEssage

{
  "result": null,
  "targetUrl": null,
  "success": false,
  "error": {
    "code": 0,
    "message": "Your request is not valid!",
    "details": "The following errors were detected during validation.\r\n - The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. Path: $ | LineNumber: 0 | BytePositionInLine: 0.\r\n",
    "validationErrors": [
      {
        "message": "The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. Path: $ | LineNumber: 0 | BytePositionInLine: 0.",
        "members": [
          "$"
        ]
      }
    ]
  },
  "unAuthorizedRequest": false,
  "__abp": true
}

Swagger screen shot


1 Answer(s)