Improved string first letter case change - #606
Open
xperiandri wants to merge 2 commits into
Open
xperiandri wants to merge 2 commits into
xperiandri wants to merge 2 commits into
Conversation
Added System.Memory refs to enable Span usage in string extension methods for first char case changes, increasing efficiency and safety.
* Replaced custom `FirstCharLower` with `System.Text.Json`'s `JsonNamingPolicy.CamelCase` for property and dictionary key conversion. * Updated serialization and file variable mapping for consistent .NET camelCase conventions. * Added `System.Text.Json` dependency and removed the obsolete extension method.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Camel-case conversion loses valid case-sensitive GraphQL field names in generated inputs and multipart paths.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Updates client-side name casing, including serialization and multipart upload paths.
Changes:
- Uses
JsonNamingPolicy.CamelCasefor serialized names. - Refactors first-character capitalization.
- Adds required JSON and memory dependencies.
File summaries
| File | Description |
|---|---|
Serialization.fs |
Applies camel-case naming during serialization. |
GraphQLClient.fs |
Applies matching naming to multipart paths. |
Extensions.fs |
Refactors first-character capitalization. |
FSharp.Data.GraphQL.Client.fsproj |
Adds package references. |
Packages.props |
Centrally versions System.Memory. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| x | ||
| |> Seq.collect (fun kvp -> | ||
| tryMapFileVariable (name + "." + (kvp.Key.FirstCharLower ()), kvp.Value) | ||
| tryMapFileVariable (name + "." + JsonNamingPolicy.CamelCase.ConvertName kvp.Key, kvp.Value) |
| | :? IDictionary<string, obj> as items -> | ||
| items | ||
| |> Seq.map (fun (KeyValue (k, v)) -> k.FirstCharLower(), toJsonValue v) | ||
| |> Seq.map (fun (KeyValue (k, v)) -> JsonNamingPolicy.CamelCase.ConvertName k, toJsonValue v) |
Test Results 9 files 9 suites 11m 5s ⏱️ Results for commit 06a7fd4. |
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.
No description provided.