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

CLI Generate Command Does not Generate Additional Properties in CALM Schema

Open jpgough-ms opened this issue 2 years ago • 2 comments

Bug Report

Steps to Reproduce:

Create an additional node in a pattern template e.g.

{
  "$schema": "https://raw.githubusercontent.com/finos-labs/architecture-as-code/main/calm/draft/2024-04/meta/calm.json",
  "$id": "https://raw.githubusercontent.com/finos-labs/architecture-as-code/main/calm/pattern/api-gateway",
  "title": "API Gateway Pattern",
  "type": "object",
  "properties": {
    "nodes": {
      ...
    },
    "relationships": {
     .... 
    },
    "custom-pattern-information" : {
     ...
    }
  },
  "required": [
    "nodes",
    "relationships",
    "custom-pattern-information"
  ]
}

Running the generate command will not add an object for custom-pattern-information

Expected Result:

All properties appear in the pattern instantiation.

Perhaps a good second step to help us discover any strange bugs or possible issues in a pattern would be to run the validate command against the produced pattern instantiation?

jpgough-ms avatar Apr 17 '24 13:04 jpgough-ms

@willosborne I believe this is expected behaviour as the calm generator is opinionated based on the core meta-schema (like nodes, relationships)?

grahampacker-ms avatar Apr 18 '24 13:04 grahampacker-ms

Indeed: the generate command will only do nodes and relationships. I did write code to have it handle additional top level properties, but there were concerned this was too custom and potentially indicative of some missing design in the CALM schema.

See #92

We can definitely add this feature if it'd be worth having.

willosborne avatar Apr 18 '24 15:04 willosborne

With the addition of the metadata section, we no longer support additional top level properties. Closing this issue

aidanm3341 avatar Jun 20 '24 14:06 aidanm3341