Skip to content

CLI: Document support for schema files on disk #384

Closed
@christhekeele

Description

@christhekeele

EDIT: It does look like there is a --path parameter! However, this is not mentioned in the CLI's help documentation. Original issue left for posterity and discoverability.

EDIT 2: Duh, I was looking at the openapi-python-client --help, and not the openapi-python-client generate --help. Closing

Is your feature request related to a problem? Please describe.
I'd like to avoid having to run a server to generate my clients, and use a path to a file.

Describe the solution you'd like

I have an api that serves an openapi.json schema.
As part of a build script, I am writing its contents to disk without actually running the server.
I'd like to be able to use this file directly to generate my API client.

The --url parameter does not support the file:// scheme; it assumes http and errors with:

Could not get OpenAPI document from provided URL

Ideally --url would either support file://; or an alternative parameter like --file could be provided in its stead.

Describe alternatives you've considered

I've thought about daemonizing my server in my build scripts just so that I have a live http url; however I'd rather avoid this.

I'm currently looking into skipping the CLI and writing a script that loads the python library directly, and poking around internal APIs to do the generation part without the http call, but that's also not lovely.

Additional context

It's possible I've missed a way to do this, but just going off the CLI help documentation there are no other parameters available to me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions