ocurity / dracon

Security scanning & static analysis tool - forked and rewritten from @thought-machine/dracon
https://ocurity.com
Apache License 2.0
61 stars 9 forks source link

176: marshal ComponentType and OrchestrationType as string #177

Closed ptzianos closed 1 month ago

ptzianos commented 1 month ago

Data structures containing fields of ComponentType or Orchestration type get marshaled as integers, because these enums are integers themselves. The problem is that a human reading these YAML/JSONs will have trouble parsing the values, unless they are well acquainted with the values of the codebase. In order to make them more human-readable, this commit adds methods to both enums that allow them to be marshaled as string values. The enums remain as integer enums because this allows to use the enum also an implicit ordering of components in the case of the ComponentType.

fixes #176