tfenster/ALRunner

https error: Failed to read the content

Closed this issue · 3 comments

Hi Tobias,
I tried to execute command ALRunner: Generate objects by parsing a Json file with the next uri "https://iatacodes.org/api/v6/airports?api_key=aa7c0f06-2054-4aa0-871d-0e60dead2492"
and I've got an error "Failed to read the content. Error: Error: unable to verify the first certificate"
Is https not supported?

Hi Dmitry,

that's interesting as it does work for me. However the repsonse of this API is not a simple JSON, but contains request and response. So unfortunately my extension wouldn't be able to handle the online version anyways. What you could do is download the repsonse json and extract only a couple of lines from the repsonse part like this

[
    {"code":"AAA","name":"Anaa"},
    {"code":"AAB","name":"Arrabury"},
    {"code":"AAC","name":"El Arish International Airport"},
    {"code":"AAE","name":"Les Salines"},
    {"code":"AAF","name":"Apalachicola Regional"}
]

Then you can run the "generate AL code from selection" command, which will give you the tables and base loading code. You would only need to tweek that a bit so that it doesn't look at the full return body, but at the "response" part

@dkatson does this work for you?