Skip to content

Add ExceptionIfMissing static parameter to JsonProvider and XmlProvider#1688

Draft
Copilot wants to merge 1 commit intomainfrom
copilot/debug-repo-assist-workflow
Draft

Add ExceptionIfMissing static parameter to JsonProvider and XmlProvider#1688
Copilot wants to merge 1 commit intomainfrom
copilot/debug-repo-assist-workflow

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

The Repo Assist workflow attempted to implement ExceptionIfMissing for JsonProvider and XmlProvider but the patch failed to apply due to a concurrent merge. This implements those changes directly.

Changes

New static parameter: ExceptionIfMissing

  • Added to both JsonProvider and XmlProvider (defaults to false for backward compatibility)
  • When true, accessing a non-optional field absent from the data raises an exception instead of silently returning "" (string) or NaN (float)

Runtime

  • JsonRuntime.GetNonOptionalValueStrict — throws on missing JSON fields
  • TextRuntime.GetNonOptionalValueStrict — throws on missing XML/CSV fields

Design-time codegen

  • JsonGenerationContext and XmlGenerationContext carry ExceptionIfMissing
  • ConversionsGenerator.convertStringValue and JsonConversionsGenerator.convertJsonValue select between GetNonOptionalValue and GetNonOptionalValueStrict based on the flag
  • TypeProviderInstantiation updated with the new field

Usage

// ExceptionIfMissing=false (default) — returns empty string for missing field
type JsonLenient = JsonProvider<"""{"name": "Alice", "age": 30}""">
let doc = JsonLenient.Parse("""{"age": 30}""")
doc.Name  // ""

// ExceptionIfMissing=true — throws for missing field
type JsonStrict = JsonProvider<"""{"name": "Alice", "age": 30}""", ExceptionIfMissing=true>
let doc2 = JsonStrict.Parse("""{"age": 30}""")
doc2.Name  // raises exception: "'name' is missing"

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.worldbank.org
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet /usr/share/dotnet/sdk/8.0.124/FSharp/fsc.dll @/tmp/MSBuildTempJsopSi/tmpb4da9a1a93714c6b98f1703eb9a3321c.rsp (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet /usr/share/dotnet/sdk/8.0.124/FSharp/fsc.dll @/tmp/MSBuildTempWprtaM/tmp19c92066e48a48139df9357346bd807e.rsp (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet /usr/share/dotnet/sdk/8.0.124/FSharp/fsc.dll @/tmp/MSBuildTempEbPPTk/tmpf7fd0ae7d5014b19aea670fbb04318b7.rsp (dns block)
  • schemas.microsoft.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.DesignTime.Tests/bin/Debug/net8.0/FSharp.Data.DesignTime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.DesignTime.Tests/bin/Debug/net8.0/FSharp.Data.DesignTime.Tests.deps.json /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.DesignTime.Tests/bin/Debug/net8.0/testhost.dll --port 46539 --endpoint 127.0.0.1:046539 --role client --parentprocessid 9173 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.DesignTime.Tests/bin/Debug/net8.0/FSharp.Data.DesignTime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.DesignTime.Tests/bin/Debug/net8.0/FSharp.Data.DesignTime.Tests.deps.json /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.DesignTime.Tests/bin/Debug/net8.0/testhost.dll --port 44603 --endpoint 127.0.0.1:044603 --role client --parentprocessid 9319 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.DesignTime.Tests/bin/Debug/net8.0/FSharp.Data.DesignTime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.DesignTime.Tests/bin/Debug/net8.0/FSharp.Data.DesignTime.Tests.deps.json /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.DesignTime.Tests/bin/Debug/net8.0/testhost.dll --port 44795 --endpoint 127.0.0.1:044795 --role client --parentprocessid 9460 --telemetryoptedin false (dns block)
  • tomasp.net
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.DesignTime.Tests/bin/Debug/net8.0/FSharp.Data.DesignTime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.DesignTime.Tests/bin/Debug/net8.0/FSharp.Data.DesignTime.Tests.deps.json /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.DesignTime.Tests/bin/Debug/net8.0/testhost.dll --port 46539 --endpoint 127.0.0.1:046539 --role client --parentprocessid 9173 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.DesignTime.Tests/bin/Debug/net8.0/FSharp.Data.DesignTime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.DesignTime.Tests/bin/Debug/net8.0/FSharp.Data.DesignTime.Tests.deps.json /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.DesignTime.Tests/bin/Debug/net8.0/testhost.dll --port 44603 --endpoint 127.0.0.1:044603 --role client --parentprocessid 9319 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.DesignTime.Tests/bin/Debug/net8.0/FSharp.Data.DesignTime.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.DesignTime.Tests/bin/Debug/net8.0/FSharp.Data.DesignTime.Tests.deps.json /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.DesignTime.Tests/bin/Debug/net8.0/testhost.dll --port 44795 --endpoint 127.0.0.1:044795 --role client --parentprocessid 9460 --telemetryoptedin false (dns block)
  • www.google.com
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.Core.Tests/bin/Debug/net8.0/FSharp.Data.Core.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.Core.Tests/bin/Debug/net8.0/FSharp.Data.Core.Tests.deps.json /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.Core.Tests/bin/Debug/net8.0/testhost.dll --port 46425 --endpoint 127.0.0.1:046425 --role client --parentprocessid 10145 --telemetryoptedin false (dns block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.Core.Tests/bin/Debug/net8.0/FSharp.Data.Core.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.Core.Tests/bin/Debug/net8.0/FSharp.Data.Core.Tests.deps.json /home/REDACTED/work/FSharp.Data/FSharp.Data/tests/FSharp.Data.Core.Tests/bin/Debug/net8.0/testhost.dll --port 35223 --endpoint 127.0.0.1:035223 --role client --parentprocessid 10307 --telemetryoptedin false (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[aw] Repo Assist failed</issue_title>
<issue_description>### Workflow Failure

Workflow: Repo Assist
Branch: main
Run: https://github.com/fsprojects/FSharp.Data/actions/runs/22560377564

⚠️ Code Push Failed: A code push safe output failed, and subsequent safe outputs were cancelled.
Code Push Errors:

  • push_to_pull_request_branch: Failed to apply patch

Action Required

Option 1: Assign this issue to Copilot

Assign this issue to Copilot using the agentic-workflows sub-agent to automatically debug and fix the workflow failure.

Option 2: Manually invoke the agent

Debug this workflow failure using your favorite Agent CLI and the agentic-workflows prompt.

Generated from Repo Assist

  • expires on Mar 9, 2026, 3:59 AM UTC

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI changed the title [WIP] Debug workflow failure for Repo Assist Add ExceptionIfMissing static parameter to JsonProvider and XmlProvider Mar 4, 2026
Copilot finished work on behalf of dsyme March 4, 2026 09:24
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.

[aw] Repo Assist failed

2 participants