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

Generate does not output placeholders for boolean properties

Open willosborne opened this issue 1 year ago • 0 comments

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:

  • output a string placeholder (will fail validation)
  • emit a warning saying to use enums instead
  • add a spectral rule to also emit this warning on pattern files

willosborne avatar Aug 20 '24 09:08 willosborne