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

Fix patch bug. Improve enums. #133

Merged
merged 1 commit into from
Feb 21, 2025
Merged

Conversation

rmouritzen-splunk
Copy link
Contributor

  • Fix patch bug where attribute descriptions were incorrectly copied back to the dictionary.
  • Drop enum sibling validation issues from error to warning.
  • Improve UI of enum attributes and enum sibling attributes.

…ck to the dictionary. Drop enum sibling validation issues from error to warning. Improve UI of enum attributes and enum sibling attributes.
@mikeradka
Copy link
Contributor

mikeradka commented Feb 21, 2025

Nice work, @rmouritzen-splunk. I may want to pick your brain on how you untangled the patch bug that we discovered through ocsf/splunk#40 for my own curiosity.

It appears to be patching the descriptions correctly for extensions with this fix:

Schema.dictionary()[:attributes][:"splunk/display_name"]
iex(10)> Schema.dictionary()[:attributes][:"splunk/display_name"]
%{
  type: "string_t",
  description: "The display name. See specific usage.",
  extension: "splunk",
  requirement: "optional",
  _links: [
    %{
      type: "user",
      group: :object,
      caption: "User",
      attribute_keys: MapSet.new([:display_name])
    }
  ],
  caption: "Display Name",
  type_name: "String",
  _source: :"splunk/user",
  extension_id: 1,
  _source_patched: :user
}
Schema.object(:user)[:attributes][:display_name]
iex(11)> Schema.object(:user)[:attributes][:display_name]
%{
  type: "string_t",
  description: "The display name of the user, as reported by the product.",
  extension: "splunk",
  requirement: "optional",
  _links: [
    %{
      type: "user",
      group: :object,
      caption: "User",
      attribute_keys: MapSet.new([:display_name])
    }
  ],
  caption: "Display Name",
  type_name: "String",
  _source: :"splunk/user",
  extension_id: 1,
  _source_patched: :user
}
image image

Also the link in the string enum sibling can be helpful for OCSF adopters:

image

@mikeradka mikeradka added bug Something isn't working enhancement New feature or request labels Feb 21, 2025
@floydtree floydtree merged commit 39a8269 into ocsf:main Feb 21, 2025
1 check passed
@rmouritzen-splunk rmouritzen-splunk deleted the enum-siblings branch February 21, 2025 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants