Repository navigation
Render supersedes and replaced-by notes for deprecations - #189
Merged
Merged
Conversation
The OCSF schema's @deprecated block now carries a "superseded_by" array naming the replacement definition(s), and the schema compiler derives a reverse ":_supersedes" marker on each replacement in browser mode. This surfaces both directions in the browser so consumers migrating off a deprecated definition can find its replacement, and anyone landing on a replacement can see what it supersedes. - page_view: adds format_item_supersedes/3 for classes and objects, append_supersedes/2 for attributes, and format_enum_supersedes/2 for enum values. Each renders a "Supersedes deprecated X" note, linking to the deprecated item's page where one exists. - page_view: adds append_superseded_by/3, rendering a "Replaced by" note on a deprecated attribute whose replacement lives in another container. Only dotted paths (e.g. "job_action.cmd_line") get a forward link; same-context replacements are covered by the reverse note instead. format_attribute_desc/3 and format_dictionary_attribute_desc/3 take an optional conn to build those links, defaulting to nil so existing callers keep working. - schema, page_controller: the classes listing page went through clean_classes_filter_extensions/1, whose filter_internal/1 strips all "_"-prefixed keys and so removed :_supersedes. Adds classes_filter_extensions/1 and switches the page to it, mirroring how the objects listing page already works. Attribute-level profile filtering is not applied, matching objects/2; the listing renders no attribute rows, and per-row profile data for the client-side filter comes from class[:profiles], which is unaffected. - data_types: links out to the OCSF storage strategies data type mappings article. - components.css: styles both notes, with dark-theme variants. Bump version to 4.5.0. Verified against a browser-mode compile of ocsf-schema: 10 class, 3 object, 179 attribute and 1 enum supersedes notes, plus 23 cross- container replaced-by links, all rendering on the class, object, listing, dictionary and profile pages. Signed-off-by: Rajas Panat <rajaspa@amazon.com>
mikeradka
approved these changes
Jul 29, 2026
rmouritzen-splunk
approved these changes
Jul 29, 2026
floydtree
added a commit
to ocsf/ocsf-schema
that referenced
this pull request
Jul 30, 2026
#### Related Issue: N/A — discussed in maintainer conversations; see Description. #### Description of changes: Today, the replacement for a deprecated item exists only as free text in the @deprecated.message string (e.g. "Use the <code>application</code> attribute instead."). The phrasing is inconsistent across the schema and not machine-readable, so tooling (including the schema browser) cannot reliably cross-reference a deprecated item with its successor. This PR introduces a required, machine-readable superseded_by field inside every @deprecated annotation, and backfills it across the entire schema. 1. Backfill — all 126 @deprecated annotations now carry superseded_by 2. Message normalization (accuracy fixes to existing text, no semantic changes) 3. Updates to the contribution guide. --- #### What consumes this: The schema compiler (browser mode) resolves superseded_by into cross-reference markers so the schema browser can render, by default, a "Supersedes ..." note on the replacement and a "Replaced by ..." link on the deprecated item. Those changes are in companion PRs to ocsf-schema-compiler and ocsf-server; this PR is self-contained and backward-compatible for consumers that ignore unknown @deprecated fields. #### Related PRs 1. #1708 - metaschema 2. ocsf/ocsf-validator#39 - validator 3. ocsf/ocsf-schema-compiler#19 - compiler 4. ocsf/ocsf-server#189 - server --------- Signed-off-by: Rajas Panat <rajaspa@amazon.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Surfaces deprecation replacements in the schema browser, in both directions.
The OCSF
@deprecatedblock now carries asuperseded_byarray naming the replacement definition(s), and the schema compiler derives a reverse_supersedesmarker on each replacement in browser mode. This PR renders both:Depends on the schema-side and compiler-side changes (see Related below). Renders nothing when the marker is absent, so it is a no-op against a schema compiled without them.
Changes
page_view.exformat_item_supersedes/3— the note for a whole class or object, linking each superseded item to its page.append_supersedes/2— the note for an attribute.format_enum_supersedes/2— the note for an enum value, resolving the deprecated value's caption for display alongside its key.append_superseded_by/3— the forward "Replaced by" note. Only dotted paths (e.g.job_action.cmd_line) get a link, since same-context replacements are already covered by the reverse note. The link targets the container page, resolvingclassesvsobjectsviaSchema.class/1.format_attribute_desc/3andformat_dictionary_attribute_desc/3take an optionalconnto build those links. It defaults tonil, andappend_superseded_by/3returns the html untouched in that case, so any caller that doesn't pass it keeps working.schema.ex/page_controller.ex— the classes listing page went throughclean_classes_filter_extensions/1.Utils.filter_internal/1strips every_-prefixed key, so_supersedesnever reached the template. Addsclasses_filter_extensions/1and points the page at it, mirroringobjects_filter_extensions/1, which the objects listing page already uses for the same reason.Note on the controller: the previous path applied attribute-level profile filtering via
clean_classes_filter_extensions_profiles/2. Dropping it is not a regression and bringsclasses/2to parity withobjects/2—filter_items_attributes_by_profiles/2filters only attributes, and the classes listing renders no attribute rows. The per-row profile data driving the client-side filter comes fromclass[:profiles], which is untouched.data_types.html.eex— links out to the OCSF storage strategies data type mappings article.components.css— styles both notes (accent color for supersedes, warning color for replaced-by), with dark-theme variants.Bumps version to 4.5.0.
Testing
mix compileclean (theunused require Loggerwarning inlib/schema.exis pre-existing onmain).mix format --check-formattedreports the same three files asmaindoes; no new findings, and the formatter's suggestions fall entirely on pre-existing lines.Ran the server against a browser-mode compile of
ocsf-schemaand verified every rendering surface:_supersedesnote above the attribute tablefinding_info→ links tofindingwin/reg_valuetype_id8 →REG_QWORD_LITTLE_ENDIAN [9]incident,data_classification,network_proxyjob.cmd_line→/objects/job_actionAlso spot-checked
/,/classes,/objects,/dictionary,/data_types,/profiles,/categories,/classes/authentication,/objects/user— all 200, and/base_event302 as expected. Multi-item notes render comma-separated (e.g.cis_benchmark, plus others).Marker counts match the compiler output exactly in every case, confirming nothing is dropped between compile and render.
Related
superseded_byacross the schema_supersedesmarker