Skip to content

criteo/criteo-api-sdk-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

update-oas-botgricher-crto
update-oas-bot
and
Feb 18, 2025
c902cea ยท Feb 18, 2025
Oct 29, 2024
Apr 21, 2023
Feb 18, 2025
Feb 17, 2025
Oct 27, 2021
Nov 7, 2024
Oct 29, 2024
Apr 21, 2023
Feb 16, 2023
Mar 25, 2024
Nov 26, 2021
Oct 26, 2021
Oct 26, 2021
Oct 27, 2021

Repository files navigation

Generate Java Sources Generate PHP Sources Generate Python Sources Generate Postman Collections

Criteo API - Clients

This project generates code for the client libraries for Criteo's API

In addition it generates Postman API documentation and publishes it to the Criteo's Postman space. If you are a user looking for more information about Criteo API on Postman please check this guide.

Generate the clients

To generate the Java code, run:

./gradlew :generator:java:generateClient

The generated code can be found under generated-sources/java folder.

To generate the Python code, run:

./gradlew :generator:python:generateClient

The generated code can be found under generated-sources/python folder.

To generate the PHP code, run:

./gradlew :generator:php:generateClient

The generated code can be found under generated-sources/php folder.

Modify templates

You can modify the generated code by changing the templates. For example, the authentication token auto refresh feature is implemented in generator/{language}/resources/templates/rest.mustache.

If a template is missing, for example for python sdk, you can copy it from the original repository Python templates.

Build Process

The generation of the clients is wrapped in a buid.gradle file. The specific options for each language are defined in other build.gradle files (python, java and php).

This script uses https://api.criteo.com public API.

A clean step has been added to the build process in order to delete the folder of previous generated code. Otherwise some changes will not be applied by openapi-generator.

Github Actions

Each time a push is done, three separate actions for each of the languages are fired :

  • Generate Java Sources
  • Generate PHP Sources
  • Generate Python Sources

Each of workflows generates output for a respective language.

There is also Generate All Sources action that is runnable on demand from Actions tab.

After running a workflow:

  • artefacts will be generated and available for download.
  • Postman collections will be generated and published.

Postman collections

Postman collections are generated only within Github Actions.

The Postman generation workflow doesn't save artifacts, but instead publishes them directly to the Criteo space on Postman. If you would like to run Postman workflow generation locally you can also use nektos/act to ease automation and testing.

To generate the Postman generation GitHub Action locally make sure Docker is installed and run:

act -W .github/workflows/generate_and_push_postman.yml

Disclaimer

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.