GithubHelp home page GithubHelp logo

Comments (7)

bufdev avatar bufdev commented on June 7, 2024

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.

bufdev avatar bufdev commented on June 7, 2024

Closing as this is a configuration issue - let us know if you have further issues.

from buf.

YvanJAquino avatar YvanJAquino commented on June 7, 2024

@bufdev I'm a bit confused on managing dependencies.

Any guidance would be useful, I'm writing this one up for posterity.

from buf.

bufdev avatar bufdev commented on June 7, 2024

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.

bufdev avatar bufdev commented on June 7, 2024

We'll also consider adding gnostic definitions as a module that we manage.

from buf.

YvanJAquino avatar YvanJAquino commented on June 7, 2024

Just the fact you all would consider that is awesome. Thank you so much for this amazing tool!

from buf.

bufdev avatar bufdev commented on June 7, 2024

Apparently the author of gnostic already uploaded it: https://buf.build/gnostic/gnostic

from buf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.