Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The top level object cannot be an array issue in dataservices #1522

Closed
dulanjalidilmi opened this issue May 4, 2020 · 1 comment · Fixed by wso2/docs-apim#5200
Closed

Comments

@dulanjalidilmi
Copy link
Contributor

Description:
When the top-level object is an array in output mapping, DS Fault : The top level object cannot be an array occurs.
.
Affected Product Version:
1.1.0

Steps to reproduce:

  1. configure a data service
  2. configure output mapping similar to the following payload.
<result outputType="json">
{
     "employee": [
            {
                "first_name": "$first_name"
            }
      ]
}
</result>
  1. Deploy the CAPP and start the server.
  2. DS Fault Message: The top level object cannot be an array will be logged.
@chanikag
Copy link
Contributor

This is because we are converting the generated XML format to JSON. We have documented this in our docs https://docs.wso2.com/display/EI660/Using+JSON+with+Data+Services.

However I couldn't find that in the MI docs. @nilminiwso2 shall we include that in MI docs if it is not already done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants