Skip to content

Conversation

@AghastyGD
Copy link
Owner

@AghastyGD AghastyGD commented Jul 20, 2025

This PR introduces a new CLI feature that allows developers to generate client SDKs (e.g., TypeScript, Dart) from the OpenAPI schema defined by Lazy Ninja-based APIs. This enhances developer experience by enabling seamless integration between backend and frontend/mobile clients.

What’s included:

  • New CLI command: lazy-ninja generate-client

  • Supports multiple output languages via openapi-generator-cli

  • Automatically resolves the OpenAPI schema without requiring the server to be running

  • Allows custom output directory and generator type

Installation

By default, openapi-generator-cli requires Java to be installed on your system.

Basic installation:

pip install lazy-ninja

⚠️ This version assumes Java is already installed and available in your system's PATH.

Alternative (bundled JDK via jdk4py):

If you don’t have Java installed, use the optional lazy-jdk extra:

pip install lazy-ninja[lazy-jdk]

This uses jdk4py to automatically bundle a lightweight JDK.

Example usage:

lazy-ninja generate-client typescript-axios --settings my_project.settings --api-module my_project.api --output ./clients/ts

closes #20

Introduces a CLI client generator for streamlined usage and adds related scripts.

Updates and standardizes dependency versions for better compatibility and maintainability.

Removes deprecated code and refactors imports to support modularization.
Adds multiple new code generation targets, including Python, Java, Kotlin, Go, C#, Ruby, and Swift, alongside existing options. Updates CLI description to clarify expanded support for generating SDKs for both frontend and backend use cases.
@AghastyGD AghastyGD self-assigned this Jul 20, 2025
@AghastyGD AghastyGD added the enhancement New feature or request label Jul 20, 2025
@AghastyGD AghastyGD merged commit 82575e2 into dev Jul 20, 2025
3 checks passed
@AghastyGD AghastyGD deleted the feat/client-code-generator branch August 11, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant