Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate does not output placeholders for boolean properties #353

Closed
willosborne opened this issue Aug 20, 2024 · 0 comments · Fixed by #500
Closed

Generate does not output placeholders for boolean properties #353

willosborne opened this issue Aug 20, 2024 · 0 comments · Fixed by #500
Assignees
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@willosborne
Copy link
Member

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 willosborne added bug Something isn't working good first issue Good for newcomers labels Aug 30, 2024
@rocketstack-matt rocketstack-matt added this to the 1.0 milestone Oct 17, 2024
@willosborne willosborne self-assigned this Oct 18, 2024
willosborne added a commit to willosborne/architecture-as-code that referenced this issue Oct 18, 2024
willosborne added a commit to willosborne/architecture-as-code that referenced this issue Oct 18, 2024
willosborne added a commit to willosborne/architecture-as-code that referenced this issue Oct 18, 2024
rocketstack-matt added a commit that referenced this issue Oct 18, 2024
…les (#500)

* #353 properly instantiate boolean properties

* #353 add spectral rule to report boolean placeholder values

* #353 add pattern rule to warn against using booleans

---------

Co-authored-by: Matthew Bain <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
2 participants