Skip to content

Cannot depend on generated client #22

@AndrewGuenther

Description

@AndrewGuenther

Hopefully I'm missing something simple, but so far as I can tell, when using openapi_generator it doesn't appear to declare and outputs. So in my use case, I am generating a Python client which will then be depended on by a py_library. This doesn't appear to work.

I'd appreciate if someone could provide an example where they depend on a generated client and how that gets wired up. Thanks!

Some additional context on what I've tried:

openapi_generator(
    name = "my_api_client_src",
    generator = "python",
    spec = ":my_api_spec.yaml",
    deps = [
        ":my_api_spec"
    ],
    visibility = ["//visibility:public"]
)

py_library(
    name = "my_library",
    deps = [":my_api_client_src"]
)

The above will claim that the my_api_client_src target doesn't contain any python files, so I've tried depending on it as data instead and making a dedicated py_library target for it, but that doesn't appear to work either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions