Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up openapi spec #10

Open
Ben-Epstein opened this issue Sep 22, 2023 · 2 comments
Open

Set up openapi spec #10

Ben-Epstein opened this issue Sep 22, 2023 · 2 comments

Comments

@Ben-Epstein
Copy link
Contributor

https://github.com/openapi-generators/openapi-python-client

@nason
Copy link
Contributor

nason commented Jun 13, 2024

Was able to generate an API client with this invoke task:

@task
def codegen(ctx: Context, openapi_url: Optional[str] = "https://app.arcee.ai/api/openapi.json") -> None:
    """codegen

    Generate code from Arcee's OpenAPI spec
    """
    ctx.run(
        "uv pip install --upgrade openapi-python-client",
        pty=True,
        echo=True,
    )
    ctx.run(
        f"openapi-python-client generate --url {openapi_url} \
            --meta none \
            --overwrite \
            --no-fail-on-warning \
            --config openapi-config.yml \
            --output-path arcee/codegen",
        pty=True,
        echo=True,
    )
    # Format the generated code
    ctx.run(
        "black arcee/codegen",
        pty=True,
        echo=True,
    )
    ctx.run(
        "ruff check arcee/codegen --fix --fix-only",
        pty=True,
        echo=True,
    )

@tleyden tleyden closed this as completed Jun 19, 2024
@nason nason reopened this Jun 19, 2024
@tleyden
Copy link
Contributor

tleyden commented Jun 20, 2024

Oh sorry @nason, I didn't realize this was still active! I only looked at the date of the initial comment and assumed it was dead, but now I see your comment was from last week.

(was just trying to clean up the inactive issues a bit)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants