Hengsin's API REST

105 views
Skip to first unread message

Igor Martins

unread,
Dec 11, 2019, 2:02:25 PM12/11/19
to iDempiere
Hi everyone,

I was testing both Hengsin and Sergey API REST. By the way both are really really great!

But thinking in a Core solution we are considering the possibility of using the Hengsin's one, just because the Generic Solution is the best way for most integrations, since we don't need to modify code to add EndPoints every necessity from the Integrators.

So i've decided to discuss with you something that i, as an integrator too, found.


1. When i was integrating our fork from iDempiere with 5 MarketPlaces using REST, i had some problems with JSON Pattern, e.g.: A product with only ID

{
   "product":{
       "id": 1
   }
}

{
   "id": 1
}

[
   {
       "id": 1
   }
]

Every MarketPlace returned me a different JSON for the same Product. So, is there some pattern for a better JSON?
The Hengsin's one return the Table and Windows starting by "[", even with one item to return. Is there a way to get around this?
I couldn't use the JSON starting by "[" in my project because most MarketPlaces integrated sends me the first example and these difference between MarketPlaces doesn't allow me to try the 
gson.fromJson(br, new TypeToken<List<JsonLog>>(){}.getType());
or something like that, so i don't know if this really works. So, we can avoid problems like that?
Is "[]" the Pettern for Lists?


2. Testing the Sergey's one i became charmed by the Swagger Docs. So, is it possible to implement Swagger too? Or any other possibility for a documentation?
i've published the Postman docs (https://documenter.getpostman.com/view/5351247/SWE83GZx?version=latest), but i was looking for some other choices, especially one that will be hosted by us.


Regards,

Igor Martins.
Reply all
Reply to author
Forward
0 new messages