Skip to content

FIX: @W-19184117@: Our JSON schema fields primaryLocationIndex, locat…#319

Merged
stephen-carter-at-sf merged 2 commits into
devfrom
sc/FixJSONSchema
Aug 1, 2025
Merged

FIX: @W-19184117@: Our JSON schema fields primaryLocationIndex, locat…#319
stephen-carter-at-sf merged 2 commits into
devfrom
sc/FixJSONSchema

Conversation

@stephen-carter-at-sf

@stephen-carter-at-sf stephen-carter-at-sf commented Aug 1, 2025

Copy link
Copy Markdown
Contributor

…ions, resources should not be marked as optional.

Rationale:

We prefer to allow consumers of our json output to not have to check if the field exists, but instead to just check the size.
Since this does not currently reflect the truth that comes from the core data structure ( see https://github.com/forcedotcom/code-analyzer-core/blob/dev/packages/code-analyzer-core/src/results.ts#L43-L53) and the translation to JSON (see https://github.com/forcedotcom/code-analyzer-core/blob/dev/packages/code-analyzer-core/src/output-formats/results/json-run-results-format.ts#L136-L139)... we should fix this.

…ions, resources should not be marked as optional
for (const tag of violationOutput.tags) {
tagsNode.node('tag').text(tag);
}
if (violationOutput.primaryLocationIndex != null) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed unnecessary if statements

@stephen-carter-at-sf stephen-carter-at-sf merged commit 0120022 into dev Aug 1, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants