Skip to content

Improved string first letter case change - #606

Open
xperiandri wants to merge 2 commits into
devfrom
improve-string-first-letter-case-change
Open

xperiandri wants to merge 2 commits into
devfrom
improve-string-first-letter-case-change

Conversation

@xperiandri

Copy link
Copy Markdown
Collaborator

No description provided.

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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.CamelCase for 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)
@github-actions

Copy link
Copy Markdown

Test Results

    9 files      9 suites   11m 5s ⏱️
  710 tests   705 ✅  5 💤 0 ❌
2 130 runs  2 115 ✅ 15 💤 0 ❌

Results for commit 06a7fd4.

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