TypeMismatchException with Auto(solved)

I get some some data from web with Xojo.Net.HTTPSocket.
Data format and requests is ok tested with, postman,paw etc…
The json data is valid tested with Json editors etc…
The code is simple.

PageReceived

[code]dim x as text
x=Xojo.Core.TextEncoding.UTF8.ConvertDataToText(content)
StreamedData=x

ReadData // Method
[/code]

ReadData

dim a as text = StreamedData //StreamedData is global property Dim DictinArray() As Auto DictinArray = Xojo.Data.ParseJSON(a)

On the DictinArray i get TypeMismatchException with reason [quote]Expected array of Auto but got class Xojo.Core.Dictionary[/quote]
Until yesterday everything work perfect…

That would indicate that the json is an object instead of an array. Look at the first character, if it’s a [ your code should work. If it’s a { then it’s an object.

the first is “{”
There is no changes in the results and the api from yesterday until today…
How is possible until yesterday to work and not now?
Results example

{ "id": 2485, "name": "Oban distiller edition", "slug": "oban-distiller-edition", "permalink": "https://demo.decobu.eu/product/oban-distiller-edition/", "date_created": "2018-06-12T14:09:57", "date_created_gmt": "2018-06-12T11:09:57", "date_modified": "2018-06-12T14:21:50", "date_modified_gmt": "2018-06-12T11:21:50", "type": "simple", "status": "publish", "featured": false, "catalog_visibility": "visible", "description": "", "short_description": "<p>? ?????? ??? 2001, ????????????? ?? Oban Distillers Edition ??? Diageo. ? ????????????? ??? ???????????? ?? ??? ???????? ?? ???????? ??????? ??????? Montilla ??? ?????????? ????? ??? ????? ??????????.</p>\ ", "sku": "5000281013398", "price": "83.00", "regular_price": "83.00", "sale_price": "", "date_on_sale_from": null, "date_on_sale_from_gmt": null, "date_on_sale_to": null, "date_on_sale_to_gmt": null, "price_html": "<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&euro;</span>83.00</span>", "on_sale": false, "purchasable": true, "total_sales": 0, "virtual": false, "downloadable": false, "downloads": [], "download_limit": 0, "download_expiry": 0, "external_url": "", "button_text": "", "tax_status": "taxable", "tax_class": "", "manage_stock": false, "stock_quantity": null, "in_stock": true, "backorders": "no", "backorders_allowed": false, "backordered": false, "sold_individually": false, "weight": "1200", "dimensions": { "length": "", "width": "", "height": "" }, "shipping_required": true, "shipping_taxable": true, "shipping_class": "", "shipping_class_id": 0, "reviews_allowed": true, "average_rating": "0.00", "rating_count": 0, "related_ids": [ 23, 47, 59, 19, 21 ], "upsell_ids": [], "cross_sell_ids": [], "parent_id": 0, "purchase_note": "", "categories": [ { "id": 111, "name": "MALT", "slug": "malt" }, { "id": 27, "name": "WHISKEY", "slug": "whiskey" }, { "id": 16, "name": "????", "slug": "pota" } ], "tags": [ { "id": 624, "name": "malt", "slug": "malt" }, { "id": 726, "name": "oban", "slug": "oban" }, { "id": 146, "name": "single malt", "slug": "single-malt" }, { "id": 52, "name": "??????", "slug": "%ce%b1%ce%bb%ce%ba%ce%bf%ce%bf%ce%bb" }, { "id": 32, "name": "??????", "slug": "%ce%bf%cf%85%ce%b9%cf%83%ce%ba%ce%b9" }, { "id": 26, "name": "????", "slug": "%cf%80%ce%bf%cf%84%ce%b1" }, { "id": 33, "name": "??????", "slug": "%cf%83%ce%ba%cf%89%cf%84%ce%b9%ce%b1" } ], "images": [ { "id": 2483, "date_created": "2018-06-12T15:46:57", "date_created_gmt": "2018-06-12T10:46:57", "date_modified": "2018-06-12T16:20:03", "date_modified_gmt": "2018-06-12T11:20:03", "src": "https://demo.decobu.eu/wp-content/uploads/2018/06/obandistillers.jpg", "name": "5000281013398", "alt": "", "position": 0 } ], "attributes": [ { "id": 2, "name": "??????", "position": 0, "visible": true, "variation": false, "options": [ "43%" ] }, { "id": 1, "name": "?????", "position": 1, "visible": true, "variation": false, "options": [ "700 ml" ] }, { "id": 3, "name": "?????????", "position": 2, "visible": true, "variation": false, "options": [ "Oban distillery" ] }, { "id": 4, "name": "????", "position": 3, "visible": true, "variation": false, "options": [ "??????" ] } ], "default_attributes": [], "variations": [], "grouped_products": [], "menu_order": 0, "meta_data": [ { "id": 18337, "key": "_vc_post_settings", "value": { "vc_grid_id": [] } }, { "id": 18372, "key": "_vc_post_settings", "value": { "vc_grid_id": [] } }, { "id": 18373, "key": "_vc_post_settings", "value": { "vc_grid_id": [] } }, { "id": 18374, "key": "_vc_post_settings", "value": { "vc_grid_id": [] } }, { "id": 18375, "key": "_wpas_done_all", "value": "1" }, { "id": 18376, "key": "fb_visibility", "value": "1" }, { "id": 18377, "key": "woodmart_sguide_select", "value": "" }, { "id": 18378, "key": "fb_product_description", "value": "" }, { "id": 18379, "key": "_product_360_image_gallery", "value": "" }, { "id": 18380, "key": "slide_template", "value": "default" }, { "id": 18381, "key": "_woodmart_single_product_style", "value": "inherit" }, { "id": 18382, "key": "_woodmart_thums_position", "value": "inherit" }, { "id": 18383, "key": "_woodmart_product_design", "value": "inherit" }, { "id": 18384, "key": "_woodmart_custom_sidebar", "value": "none" }, { "id": 18385, "key": "_woodmart_extra_content", "value": "0" }, { "id": 18386, "key": "_woodmart_extra_position", "value": "after" }, { "id": 18399, "key": "fb_product_group_id", "value": "1726536234091145" }, { "id": 18400, "key": "fb_product_item_id", "value": "1726536247424477" }, { "id": 18402, "key": "_aioseop_keywords", "value": "blended whisky,????" } ], "_links": { "self": [ { "href": "https://demo.decobu.eu/wp-json/wc/v2/products/2485" } ], "collection": [ { "href": "https://demo.decobu.eu/wp-json/wc/v2/products" } ] } }

Is possible to check if is “array or object” before I pass the data to array or dictionary?

No. Just use :

dim dictinArray as Xojo.Core.Dictionary

If this was working yesterday and the json hasn’t changed, you must have added the () after dictinArray.

Ok thank you @Greg O’Lone