clemensv / xregistry-cli

This project is a command line client for CNCF xRegistry
Apache License 2.0
15 stars 2 forks source link

Feature: "generate" option --for #6

Open clemensv opened 1 year ago

clemensv commented 1 year ago

The --for option takes a list of relative JSON Pointer paths into the --definitions file, for instance "/endpoints/myConsumer" or "/definitiongroups/myGroup" or "/definitiongroups/myGroup/definitions/myDefinition" and anchors the code generator on the specified object(s).

That has the effect that the code generator will only consider the given object(s) and its parents and dependencies. If you specify a particular message definition and create a producer client, that producer client will only emit the code for that particular message and not the full group.

When the option is applied, the generator creates an in memory copy of the definitions graph and only copies the selected elements and their parents/dependencies from the source into the target graph and then runs the generator on that copy.