finos / architecture-as-code

"Architecture as Code" (AasC) aims to devise and manage software architecture via a machine readable and version-controlled codebase, fostering a robust understanding, efficient development, and seamless maintenance of complex software architectures
https://calm.finos.org/
Apache License 2.0
59 stars 31 forks source link

Generate does not output placeholders for boolean properties #353

Open willosborne opened 2 months ago

willosborne commented 2 months ago

Bug Report

Steps to Reproduce:

Add a boolean field to a node, relationship or metadata object

e.g.

{
    "type": "object",
    "properties": {
          "propertyBoolean": {
                  "type": "boolean"
           }
      }
}

Expected Result:

{
     "propertyBoolean": "{{ PROPERTY_BOOLEAN }}"
}

Actual Result:

{}

Environment:

Latest version of CLI

Additional Context:

Placeholder values are tricky here. We can't just output false as this could be dangerous. We should consider a warning to use enums instead of booleans. Suggested fix for booleans is:

rocketstack-matt commented 10 hours ago

I was reviewing the newly launched tour.json-schema.org (which is very cool btw, going to link it from our docs).

So it turns out we have another option here by combining boolean and null type.

If we defined the type as

{
  "type": ["boolean", "null"]
}

then we could use a null placeholder, the schema would be valid but we could warn the null placeholder.