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

[REQ] gRPC client/server libs snippet engine templating plugin #5096

Open
gattytto opened this issue Jan 23, 2020 · 1 comment
Open

[REQ] gRPC client/server libs snippet engine templating plugin #5096

gattytto opened this issue Jan 23, 2020 · 1 comment

Comments

@gattytto
Copy link

gattytto commented Jan 23, 2020

googleapis use a specific templating engine for their client-side SDK.

the template engine uses .snip files present in https://github.com/googleapis/gapic-generator/tree/master/src/main/resources/com/google/api/codegen

.snip snippet file example:

# Provides common utility functions.

#
# A logical and.
#
@snippet and(a, b) horizontal
  @if a
    @if b
      and: true
    @end
  @end
@end

the template engine implementation is made using Java and the code seems to include linting functions for validation and also some "common practices" and certification-included checks. Code is present here:
https://github.com/googleapis/api-compiler/tree/master/src/main/java/com/google/api/tools/framework/snippet

and then there's yet an additional tool called gapic-generator. This tool grabs some features from the api-compiler (like the mentioned .snip templating engine, a yaml-based engine for default settings definition, and more) and serves as an executable CLI tool to generate the client libs, which can also be fed with Artman (yet another tool) ready pipelines for the client lib generation.
https://github.com/googleapis/gapic-generator

Artman is the final wrapper around the tools, according to the artman readme:

The artman tool is a wrapper around toolkit; it takes the configuration enumerated above, normalizes it, and sends it to *toolkit, which generates a client library on disk, and then artman performs some concluding cleanup.

Client libraries produced in this way are executable "out of the box", and include basic reference documentation, and appropriate packaging and metadata files.

*toolkit= the previous codename of gapic-generator
it would be very useful to have a plugin in the openapi-generator that can consume the grpc schemas generated by: #3818 and user created .snip files to make gRPC client/server libs

@gattytto
Copy link
Author

@wing328 you mind if I ping you here? since you made the commit for #3818

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant