struct

CWE::MappingNotes

Inherits JSON::Serializable < Struct < Value < Object

MappingNotes serializes its usage enum as the human-readable label rather than the underscored Crystal name.

Constructors

new(usage : CWE::MappingUsage = MappingUsage::Other, raw_usage : Nil | String = nil, rationale : Nil | String = nil, comments : Nil | String = nil, reasons : Array(String) = [] of String, suggestions : Array(CWE::MappingSuggestion) = [] of MappingSuggestion)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

comments
Source
rationale
Source
raw_usage
Source
reasons

Mapping_Notes/Reasons/Reason/@Type values such as "Frequent-Misuse", "Acceptable-Use", "Prohibited", "Abstraction", etc.

Source
suggestions

Mapping_Notes/Suggestions/Suggestion — a list of related CWEs that MITRE recommends as alternative mapping targets.

Source
to_json(json : JSON::Builder) : Nil
Source
usage

Every field carries a default so that the omit-when-empty shape written by MappingNotes#to_json can be read back by MappingNotes.from_json. Without them the round-trip failed with "Missing JSON attribute" for any entry that had no reasons or suggestions.

Source