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

Example Usage Documentation #6

Closed
jonahgeorge opened this issue Nov 14, 2019 · 5 comments
Closed

Example Usage Documentation #6

jonahgeorge opened this issue Nov 14, 2019 · 5 comments

Comments

@jonahgeorge
Copy link

Would it be possible to put an example of usage within a go_library target on the README? I've been having some trouble getting this to function (likely from lack of experience with Bazel).

The following code always results in "Unknown source type openapi"

openapi_generator(
    name = "openapi",
    generator = "go-experimental",
    spec = "openapi.json",
)

go_library(
    name = "go_default_library",
    srcs = [":openapi"],
    importpath = "github.com/jonahgeorge/openapi-client",
    visibility = ["//visibility:public"],
)

go_binary(
    name = "exbin",
    srcs = ["main.go"],
    deps = [":go_default_library"],
    visibility = ["//visibility:public"],
)
@wing328
Copy link
Member

wing328 commented Apr 6, 2020

@jonahgeorge sorry for late reply. We welcome PR to enhance the readme.

@nathanworms
Copy link

I am running into this same issue. Any recommendations on how to actually use this rule to generate openapi model files which can be used as dependencies for a go_binary or a go_library?

I have found that a .go extension can be added to the target name, but that runs into other issues because non .go files are created too.

@tony-scio
Copy link

Same issue here, trying to figure out a java_library wasn't obvious to me. Did anyone else figure this out? I'd be happy to PR the example if so (or when I figure it out).

@Dogild
Copy link

Dogild commented Dec 21, 2021

Same issue here with go_library, did anyone else figure this out?

@loeffel-io
Copy link

+1

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

6 participants