Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "10.0.103",
"rollForward": "minor"
"version": "10.0.100",
"rollForward": "latestPatch"

Copilot AI Mar 10, 2026

Copy link

Choose a reason for hiding this comment

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

global.json now pins the SDK to feature band 10.0.100 with rollForward: latestPatch. This requires a 10.0.1xx SDK to be installed; it will not roll forward to a newer feature band (e.g., 10.0.2xx). The workflow currently installs 10.0.x, which may resolve to a different feature band over time and cause dotnet to fail with “SDK not found” when global.json can’t be satisfied. Consider aligning CI with global.json (e.g., install 10.0.100/10.0.1xx, or configure setup-dotnet to use the global.json), or relax rollForward back to a mode that allows feature-band roll-forward if that’s intended.

Suggested change
"rollForward": "latestPatch"
"rollForward": "latestFeature"

Copilot uses AI. Check for mistakes.
}
}
17 changes: 17 additions & 0 deletions src/SwaggerProvider.Runtime/RuntimeHelpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,22 @@ module RuntimeHelpers =
content
| _ -> failwith $"Unexpected parameter type {boxedStream.GetType().Name} instead of IO.Stream"

// Unwraps F# option values: returns the inner value for Some, null for None.
// This prevents `Some(value)` from being sent as-is in form data.
let private unwrapFSharpOption(value: obj) : obj =
if isNull value then
null
else
let ty = value.GetType()

if
ty.IsGenericType
&& ty.GetGenericTypeDefinition() = typedefof<option<_>>
then
ty.GetProperty("Value").GetValue(value)
else
value
Comment on lines +148 to +162

Copilot AI Mar 10, 2026

Copy link

Choose a reason for hiding this comment

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

The comment says this returns “inner value for Some, null for None”, but this implementation also returns null for Some null (because it unwraps to the inner null). That means Some null will be treated the same as None downstream (e.g., dropped by Option.ofObj). Please clarify the comment to reflect the actual behavior, or adjust the unwrapping logic if preserving Some null is important for form serialization.

Copilot uses AI. Check for mistakes.

let getPropertyValues(object: obj) =
if isNull object then
Seq.empty
Expand All @@ -162,6 +178,7 @@ module RuntimeHelpers =
| _ -> prop.Name

prop.GetValue(object)
|> unwrapFSharpOption
|> Option.ofObj
|> Option.map(fun value -> (name, value)))

Expand Down
Loading