Skip to content

Conversation

@moldis
Copy link
Contributor

@moldis moldis commented Nov 24, 2025

OpenAPI support within the dazl-client library:

Added auto-generated support for OpenAPI clients (JSON-based) using the openapi-python-client library.

Introduced new Makefile targets:

download-openapi — downloads the Swagger definition from the Splice node and stores it in the cache folder.
generate-api — generates Python bindings (models and methods), stores the generated classes in python/dazl/__gen_api/openapi, and applies header updates and method fixes for compatibility.
clean-openapi — removes the downloaded Swagger definition.

  • Exported API methods via python/dazl/api/__init__.py, making them available for developers to import, and added AuthenticatedClient.
  • Updated the sandbox launcher to support JSON API.
  • Added basic unit test coverage for the generated API methods.

Example of usage in actual code:

timeout = httpx.Timeout(10.0, connect=5.0) async with AuthenticatedClient( base_url=sandbox_v3.url, token="test-token", timeout=timeout, ) as client: response = await get_v2_parties.asyncio(client=client) assert isinstance(response, ListKnownPartiesResponse) 

Ignore files in python/dazl/_gen_api/openapi, since they autogenerate

@moldis moldis changed the title [WIP] openapi support openapi support Nov 26, 2025
@moldis moldis marked this pull request as ready for review November 26, 2025 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant