-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Description
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