Comments (7)
The problem is that you are including the files directly into your main module, in which case buf
will generate stubs for them like any of your other files in api
. You can't exclude
these files - this is excluding them at the build stage, not the generate stage, and at the build stage you need all imported files present. To make this so, what you want is to add buf.build/googleapis/googleapis
as a dependency in your buf.yaml
:
version: v1
deps:
- buf.build/googleapis/googleapis
breaking:
use:
- FILE
lint:
use:
- DEFAULT
Then, inside api
, run buf mod update
.
By default, buf generate
won't generate code for imports, and you've already excluded rewriting the Go package for buf.build/googleapis/googleapis
in your buf.gen.yaml
, so you will get the correct google.golang.org
imports.
I don't know where openapiv3 came from - where are these files from?
from buf.
Closing as this is a configuration issue - let us know if you have further issues.
from buf.
@bufdev I'm a bit confused on managing dependencies.
- how does buf.build/googleapis/googleapis resolve into the right dependency set?
- How would I add dependencies from other libraries such as https://github.com/google/gnostic/blob/main/openapiv3/OpenAPIv3.proto?
Any guidance would be useful, I'm writing this one up for posterity.
from buf.
how does buf.build/googleapis/googleapis resolve into the right dependency set?
I'm not quite sure what you mean here, but buf mod update
will pin to a specific commit. See https://buf.build/docs/bsr/module/dependency-management for more details.
How would I add dependencies from other libraries
You can make your own module with these files in them. See https://buf.build/docs/bsr/module/configure for more details.
from buf.
We'll also consider adding gnostic definitions as a module that we manage.
from buf.
Just the fact you all would consider that is awesome. Thank you so much for this amazing tool!
from buf.
Apparently the author of gnostic already uploaded it: https://buf.build/gnostic/gnostic
from buf.
Related Issues (20)
- mod update panics when dependencies are from multiple registries HOT 1
- Failure: 403 Forbidden HOT 4
- `buf generate` does not use correct `buf.lock` when using `--config` with `git` source HOT 2
- Generate implicit dependencies HOT 4
- unknown extension grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema HOT 2
- WARN bufimagebuild File imports not found in your local dependencies HOT 4
- Fails to install on BSDs HOT 1
- Field plugin not found in type bufgen.ExternalPluginConfigV1 HOT 1
- Stubs are stored under the initial path where proto files can be found HOT 2
- Clarification on RPC and Request/Response Names HOT 2
- Error installing buf via go install HOT 1
- `ignore`/`build.excludes` with glob/regex/pattern HOT 1
- language_version not specified in .pre-commit-hooks.yaml HOT 3
- buf generate get an error HOT 1
- Error with buf build on bazel external dependency HOT 4
- lint: Excluding a rule doesn't seem to work HOT 4
- Unable to use buf without bsr HOT 2
- Issues with protovalidate when linting a proto file with repeated fields and protovalidate constraints HOT 2
- Resource locking serializes concurrent buf executions? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from buf.