How do I create a JSON Array document from a website return or a file?

I am just returning to webMethods development after being away for a few years. I have a JSON file that is in an array format. It is actually the output of a website. When I try to create a JSON Document in the Designer I get an Error on the format. This is a very standard well known site and I have successfully used this site in other environments.

The error I get while trying to “Create a New JSON Document Type” is:

Invalid JSON schema: #: expected type is one of Boolean or JSON Object, found: JSON Array

Link to website is: APOD website


image

A copy of the JSON file is attached

Can anyone help :worried: :worried: :worried: :worried?

apod.txt (8.4 KB)

What version of Integration Server are you using? Support for JSON documents with an array at the root was added (I think) in 9.10. The generated doctype will have an array element at its root with a name of $rootArray.

image

Michael, I was testing this to help Page and here are my observations -

  • When I try to create a “JSON Document Type” artefact, both the URL and File options fail with the error message that Page shared (this artefact was not in the 9.x versions)

  • I did succeed by creating the good old “Document Type” and then selecting JSON as the source type; this was successfully created with the structure you have shown above

Thus, the question is whether JSON Document Type artefact supports creating from JSON Arrays (possible bug, if it does) or not.

KM

1 Like

!(file:///C:/SoftwareAG/Designer/eclipse/plugins/com.softwareag.common.eclipse_10.7.0.0000-0054/about/sag_logo.png)

Software AG Designer 10.7

Thanks Michael, Wouldn’t you know it. I come back to wM after 2 years and find a bug in the first weekend. That’s what I get for trying something new. I will give it the good old fashion try.

As Venkata said using the New Document type with type JSON on the very same input works. here is the picture of the results.

image

Yep. Looks like something the JSON Document Type does not handle, but should. Please create a support ticket. Thanks …Michael

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.