Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Miguel Grilo
11
Views
4
Comments
[ardoJSON] Google Books API integration
Question
Integration
JSON
Forge
ardoJSON (O11)
Forge asset by
João Barata
Hi there, i'm using the ardoJSON extention to integrate the google books api but i'm having some problems.
This is the link that generate the JSon content to transform in a record list on Outystems Platform:
https://www.googleapis.com/books/v1/volumes?q=harry+potter&maxResults=1
T
he follow error occurs on service center:
Message:
Unable to cast object of type 'Newtonsoft.Json.Linq.JArray' to type 'Newtonsoft.Json.Linq.JObject'.
Stack:
at OutSystems.NssardoJSON.CssardoJSON.readSimpleValue(JToken json, Type fieldType)
at OutSystems.NssardoJSON.CssardoJSON.readRecord(JObject json, Object rec)
at OutSystems.NssardoJSON.CssardoJSON.MssJSON2RecordList(String ssJSON, Object ssRecordList)
at ssBookify_Amazon_WS.RssExtensionardoJSON.MssJSON2RecordList(HeContext heContext, String inParamJSON, Object inParamRecordList)
If anyone knows why let me know.
Thank u
Best Regards
Miguel Grilo
Ricardo Silva
Hi Miguel,
It seems like the error stems from a structural mismatch between JSON and the OutSystems structure (it's expecting an array because it has a record list and getting an object).
[EDIT] Actually, in this case it's the other way around. It's getting a JSON array when it's expecting an object (because on the structure it was defined as Record)
Can you provide us with the eSpace you're trying to consume this API ?
Miguel Grilo
Hi Ricardo thanks for the fast reply
There's the OML that consume the API, only have test pages and nothing else.
Cheers
Miguel Grilo
Bookify_Amazon_WS_v94.oml
Ricardo Silva
I made the following changes and could make it work with that JSON:
Wrapper Structure: change items type from Record to Record List
VolumeInfo Structure: change authors type from Record of authors to Record List of Text
Let me know if that also works for you.
Miguel Grilo
Thanks Ricardo i've tested and works fine to!
Best Regards
Miguel Grilo
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...