Skip to content

Should we explore open-api-generator further? #5

@paololucchino

Description

@paololucchino

Hi @ValerioGiuffrida ,

In the use-open-api-generator branch, you will find the a complete auto-generated API client for the endpoints currently available in the swagger.json on catalog.api.wfp.org using https://openapi-generator.tech/docs/installation

In the README there is a code example that I have tested and works (you just need to place your token in the code). The auto-generated docs also show all the endpoints that have been immediately available. As you are familiar with the API, it should be easy to see the small changes one would need to make to point to different endpoints.

The advantage of this approach is that the code for all the endpoints is generated in seconds, and this could be done in all these languages. The code can be regenerated easily anytime endpoints change. The way one makes a call is a little clunky but not the end of the world.

If we were to go down this route, we would need to integrate this code with the functionality to refresh the token automatically. Probably not very difficult, but still something to spend some time on.

So my question here is: does this auto-generated client seem like a good way to go? If yes, the next step would be to look into the token refresh.

cc @martinig94 @trenouard

Metadata

Metadata

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions