Skip to content

Conversation

gautamdsheth
Copy link
Collaborator

Before creating a pull request, make sure that you have read the contribution file located at

https://github.com/pnp/powerShell/blob/dev/CONTRIBUTING.md

Type

  • Bug Fix
  • New Feature
  • Sample

Related Issues?

Fixes #X, partially fixes #Y, mentioned in #Z, etc.

What is in this Pull Request ?

Please describe the changes in the PR.

Guidance

  • You can delete this section when you are submitting the pull request.*
  • Please update this PR information accordingly. We use this as part of our release notes in monthly communications.
  • Please target your PR to Dev branch. If you do not target the Dev branch we will not accept this PR.

@Copilot Copilot AI review requested due to automatic review settings October 1, 2025 17:28
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request refactors URL construction for batch sensitivity label assignment operations by eliminating a helper method and directly constructing URLs inline. The changes simplify the code structure while ensuring proper URL formatting for both batch and non-batch operations.

  • Removed the GetRequestUrl helper method and inlined URL construction
  • Updated batch request URL format to exclude the "v1.0/" prefix for compatibility
  • Simplified JSON serialization by removing custom serializer options

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

};

return JsonSerializer.Serialize(payload, serializerOptions);
return JsonSerializer.Serialize(payload);
Copy link

Copilot AI Oct 1, 2025

Choose a reason for hiding this comment

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

Removing the JsonIgnoreCondition.WhenWritingNull option may cause null values to be serialized into the JSON payload, potentially affecting API behavior. Consider whether null properties should be explicitly excluded from the serialized output.

Suggested change
return JsonSerializer.Serialize(payload);
var options = new JsonSerializerOptions
{
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
};
return JsonSerializer.Serialize(payload, options);

Copilot uses AI. Check for mistakes.

@gautamdsheth gautamdsheth merged commit c0462e5 into dev Oct 1, 2025
2 checks passed
@gautamdsheth gautamdsheth deleted the fix/sensi-batch branch October 3, 2025 08:36
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.

1 participant