architecture-as-code icon indicating copy to clipboard operation
architecture-as-code copied to clipboard

Calm CLI - Pattern Instantiation

Open grahampacker-ms opened this issue 1 year ago • 2 comments

Feature Request

Description of Problem:

The calm CLI should be able to take a reference to a pattern schema and create a concrete instantiation of that pattern with placeholder values.

This relates to issue #53

Potential Solutions:

Using an existing npm library, generate a JSON object from the provided schema. One library of interest is "JSON Schema Faker". The result should also be verified by checking it adheres to the original JSON Schema.

The command may look something like: calm generate -s [URL/file path] calm generate --source [URL/file path]

I am suggesting generate over instantiate as it's less likely to have spelling mistakes when typing it.

grahampacker-ms avatar Mar 22 '24 13:03 grahampacker-ms

I have started work on this.

willosborne avatar Mar 26 '24 14:03 willosborne

This is done for the current version of CALM, without interfaces (see issue #48 )

Currently this lacks some features that will be implemented later:

  • load pattern from a URL - only files are supported now
  • follow $refs in pattern files - not supported, limits reuse in pattern files
  • run validation against generated instantiation after generation has completed. Needs validation command to be working first.

willosborne avatar Apr 02 '24 10:04 willosborne