Skip to content

criteo/openapi-clients-analysis

Repository files navigation

openapi-clients-analysis

This project aims to provide a setup to generate OpenAPI clients in various languages using multiple toolchains and to compare them.

Getting Started

Requirements:

git clone https://github.com/criteo/openapi-clients-analysis.git
cd openapi-clients-analysis/
make

Features

Current setup

Language Generators
C# Kiota 1.29.0, NSwag 14.6.2, OpenAPI Generator 7.17.0
Python Kiota 1.29.0, OpenAPI Generator 7.17.0

Specification and client generation

API endpoints are described in the openapi.yaml OpenAPI 3.0 specification. We generate all clients directly from it.

Each generated client corresponds to a task in the Makefile. To generate all the clients, simply run:

make  # add -j4 to build them in parallel

The outputs are in the clients directory.

OpenAPI mock server

To mock the OpenAPI specification, run:

./mock.sh

This launches a Prism mock server on http://127.0.0.1:4010 that listens to all specified endpoints, validates requests, and returns the responses defined under example: in each endpoint’s specification.

C# tests

A NUnit suite to test all three C# clients is maintained in Criteo.OpenApiClientsAnalysis.UTest.

To run the tests, start the mock server, then:

dotnet test

Python tests

No proper test suite yet, just some playground scripts colocated next to the generated clients in clients/python.

uv sync   # setup .venv and install clients
uv run <script.py>

About

OpenAPI generated clients analysis setup

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published