Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

srp_jsonX

What is the reason for this error which creates an error response even though the response to be returned is correctly formed.
As I am error testing this stops the valid json response.

WARNING: Cannot close the root. Use SRP_Jsonx_End instead.

Removing the the last closing SRP_JsonX('}') fixes the issue.

Comments

  • Do you have an srp_jsonX_Begin (or BeginString) for which you don't have a corresponding SRP_Jsonx_End?
  • The problem is that you were trying to manually close the json with SRP_JsonX('}') instead of using SRP_JsonX_End, which closes the json for you.
  • Yes, I am using SRP_JsonX_End to return the json.
    I was counting the { in the srp_jsonX_BeginString when counting the { to have the correct number of } at the end.
    I will remember not to include them.
Sign In or Register to comment.