Skip to content

Fix System.Text.Json versions#771

Merged
sebastienros merged 1 commit intomainfrom
sebros/stj
Mar 24, 2025
Merged

Fix System.Text.Json versions#771
sebastienros merged 1 commit intomainfrom
sebros/stj

Conversation

@sebastienros
Copy link
Copy Markdown
Owner

Use LTS version (8.0.5) when the dependency is required:

  • netstandard2.0 required the STJ package
  • net6.0 doesn't have JsonNamingPolicy so the package is referenced

@sebastienros sebastienros requested review from Copilot and lahma March 24, 2025 01:00
Copy link
Copy Markdown
Contributor

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 PR adjusts dependency management for System.Text.Json by updating conditional compilation directives and test expectations to use the LTS version (8.0.5) and support different .NET target frameworks.

  • Modified using directives and preprocessor conditions in MemberNameStrategies.cs.
  • Updated the test assertions in TemplateTests.cs to reflect the new behavior for NET8_0_OR_GREATER.
  • Removed a redundant using directive in TemplateOptions.cs.

Reviewed Changes

Copilot reviewed 3 out of 6 changed files in this pull request and generated no comments.

File Description
Fluid/MemberNameStrategies.cs Updated preprocessor directives and modified member naming strategy methods.
Fluid.Tests/TemplateTests.cs Revised expected outputs for member naming based on the new .NET conditions.
Fluid/TemplateOptions.cs Removed an unnecessary using directive for System.Text.Json.
Files not reviewed (3)
  • Directory.Packages.props: Language not supported
  • Fluid/Fluid.csproj: Language not supported
  • Versions.props: Language not supported
Comments suppressed due to low confidence (1)

Fluid/MemberNameStrategies.cs:14

  • The fields 'CamelCase' and 'SnakeCase' are declared but not assigned any values in the current configuration, which may lead to null reference issues at runtime. Consider assigning them to the appropriate renaming methods (e.g., 'RenameCamelCase' and 'RenameSnakeCase') in all target framework conditions.
public static readonly MemberNameStrategy CamelCase;

@sebastienros sebastienros merged commit 4084b81 into main Mar 24, 2025
1 check passed
@sebastienros sebastienros deleted the sebros/stj branch March 24, 2025 01:04
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