Code Monkey home page Code Monkey logo

api's People

Contributors

alecmerdler avatar ecordell avatar jakedt avatar jon-whit avatar jonwhitty avatar josephschorr avatar jzelinskie avatar reify-tanner-stirrat avatar samkim avatar vroldanbet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

api's Issues

Modify proto files to improve generated Java code

Background

(take this explanation with a grain of salt; I would not call myself an expert on protobuf and generated code)

You can see the problem here: https://github.com/authzed/authzed-java/blob/main/examples/v1/App.java#L10-L25

This is apparently related to an old behavior of protoc where you could only have a single top-level proto def in a file because you can only have a single top-level class def in a java file. The solution to this was to have protoc generate a wrapper class to bundle up the various definitions in a proto file, which produces the FooOuterClass definitions in the generated Java code.

This ends up being confusing to a user of the library, because whether you need to use FooService or FooServiceOuterClass is entirely down to how many things are defined in the source proto file, which isn't visible to a user of the library without diving into either the jar definition or the proto files.

Proposed fix

Using java_multiple_files in the proto definition as an option should fix this and make the produced code less janky.

Caveat

This will be a breaking change to authzed-java, because all code that referenced FooServiceOuterClass will need to now reference FooService (or something like that).

Address versioning for OpenAPI

The generated OpenAPI currently pulls in these all APIs, the older ones (v0, v1alpha1) which have no OpenAPI configuration and conflicting names.

Is there a better way to generate the *.pb.h.cpp *.grpc.h.cpp files?

If I use buf generate buf.build/authzed/api, it will only generate authzed/api/ c++ code, without dependencies needed like google/api.
How I fix this problem now is I copy all the .proto files into following folder structure:

Protos
├── authzed
│   └── api
│       └── v1
│           ├── core.proto
│           ├── debug.proto
│           ├── error_reason.proto
│           ├── openapi.proto
│           ├── permission_service.proto
│           ├── schema_service.proto
│           └── watch_service.proto
├── google
│   └── api
│       ├── annotations.proto
│       └── http.proto
├── protoc-gen-openapiv2
│   └── options
│       ├── annotations.proto
│       └── openapiv2.proto
└── validate
    └── validate.proto

But I think it's not an elegant way to do that if authzed dependencies and itself have updates, then I need to redo those copy again.
I think it would be nice that buf generate will also generate dependencies minimal set needed.
Is there a better way to achieve this?

Allow `:` in ObjectIds

The current regex:

^(([a-zA-Z0-9/_|\\-=+]{1,})|\\*)$

Doesn't allow for object ids that include : as separators, which are sometimes used in user identifiers.

Mark authzed.api.v0 as deprecated

Once we've published a timeline for formally dropping support for the v0 API, we'll mark the gRPC services as deprecated.

I'm not sure if this is something formally supported by the buf registry.

cc @bufdev

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.