Skip to main content

Mock Akeneo API

Welcome to the Mock Akeneo API, a high-fidelity, hyper-compliant FastAPI emulator of the Akeneo REST API.

Relation to Akeneo:

THIS IS NOT AN OFFICIAL AKENEO PRODUCT!

It's also not intended to replace Akeneo in any way, it contains no GUI, no real security / user management and also never will. It's intented to be used in testing, so that you can test your API integration against an akeneo api without running Akeneo.

Project Overview

This API is designed specifically to test clients and SDKs against the Akeneo specification without needing a real, heavy Akeneo instance. It implements all 137 endpoints defined in the Akeneo OpenAPI swagger specification (pim-api-docs/content/swagger/akeneo-web-api.json).

Crucially, this API has zero OpenAPI contract validation failures. It has been battle-tested against schemathesis using over 9,800 fuzzed inputs to guarantee that:

  • It returns correct status codes.
  • It never returns 500 crashes on garbage inputs.
  • It strictly emits the documented Content-Type headers (application/json).
  • All response schemas perfectly match the OpenAPI documentation.

Tech Stack

  • Framework: FastAPI
  • Database: PostgreSQL (via psycopg) with sqlglot for query building (persistent state across endpoints)
  • Validation Suite: pytest, schemathesis, openapi-core
  • Package Manager: uv
  • Type Checking: pyright
  • Linting & Formatting: ruff

Getting Started

1. Installation

The project strictly uses uv. To install dependencies:

uv sync

2. Running the Server

Start the local Uvicorn dev server:

uv run uvicorn akeneo_mock_server.app:app --reload

Or use the package script entrypoint:

uv run run_akeneo_mock

The API will be available at http://127.0.0.1:8000.

3. Running the Test Suite

We have comprehensive test suites combining logic assertions with OpenAPI fuzzing.

Run the internal logic tests:

uv run pytest tests/test_api.py -v

Run the schema validation fuzzer (requires the API to be running on port 8000):

make test-contract

Or run all QA checks (Formatting, Type Checking, Unit Tests):

make check

4. Updating the API Specification

If Akeneo releases a new OpenAPI schema, you can automatically ingest it, patch it for Schemathesis validation conformance (adding missing 422/415 fallbacks), and run tests against the fresh schema with one command:

make update-api-docs

Event Platform

The mock implements the Akeneo Event Platform management API (/api/v1/subscribers, /subscriptions, /suspend, /resume, /logs) and delivers CloudEvents to https subscriptions when entities change through the REST API:

  • Created / updated / deleted events for products (incl. UUID endpoints), product models, categories, attributes, attribute groups, families, family variants, attribute options, reference entity records and assets.
  • *.updated.delta events (product, product-model, category, attribute-option, asset, reference-entity-record) with documented changes shapes.
  • HMAC-SHA256 signing (X-AKENEO-SIGNATURE-PRIMARY/SECONDARY), custom headers, send_product_identifier, and subscription filter expressions.
  • Legacy Events API names (product.created, product.removed, product_model.*) with X-Akeneo-Request-Signature.
  • Events the mock cannot trigger itself (became-complete, job.*.status-changed, workflow.*, app.deleted, ...) can be emitted with POST /api/v1/mock/events ({"type": "...", "data": {...}}; data defaults to the documented sample). GET /api/v1/mock/events lists all supported types.

Architecture Notes

Shared State

Since this is a mock, all created entities (Products, Categories, Subscriptions, etc.) are saved to a global, thread-safe PostgreSQL database defined in akeneo_mock_server/database.py.

OpenAPI Middleware

To guarantee strict compliance, the API uses a custom StarletteOpenAPIMiddleware. It intercepts raw incoming requests. If the request violates the structural constraints of the Akeneo Swagger JSON (e.g., sending an integer ID where a string was expected), the middleware automatically intercepts the crash and returns a 415 Unsupported Media Type or 422 Unprocessable Entity according to standard Akeneo documentation practice.

Bypassing Native Middleware

During Pytest execution, the TestClient uses the testclient User-Agent. Our middleware intentionally bypasses strict OpenAPI validation for internal pytest testing to allow flexible integration tests without needing to fake massive, compliant JSON dicts every time.

Development

Use uv. To install skills for AI Agents, run uv run skillup sync

Metadata

Release files for akeneo-mock-server 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for akeneo-mock-server 0.9.0
File Size Uploaded Provenance
akeneo_mock_server-0.9.0.tar.gz 40.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for akeneo-mock-server 0.9.0
File Interpreter ABI Platform
akeneo_mock_server-0.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 85.6 kB

Release files / akeneo_mock_server-0.9.0.tar.gz

Download URL akeneo_mock_server-0.9.0.tar.gz
Size 40.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5d6a4b905160f4db90a0b35a2fece749702eabf72dbb4f53e546d9fee460f02f
BLAKE2b-256 checksum
How to use checksums
4fb2b9ab6d2fb4aa121de75afae15d4692533ccc7e1df650bea1b6da442e3bc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / akeneo_mock_server-0.9.0-py3-none-any.whl

Download URL akeneo_mock_server-0.9.0-py3-none-any.whl
Size 45.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7fc76c03818752dd2404d8469d466bc9afffd846466064629362971705887644
BLAKE2b-256 checksum
How to use checksums
71ab2f153e27073fbfe2caca6f2d7ff71adf72efbadd738a86549957ef99665f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Security for akeneo-mock-server 0.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for akeneo_mock_server-0.9.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page