Skip to content

[Repo Assist] Add ApiDocParameter and ApiDocReturnInfo named record types#1066

Open
github-actions[bot] wants to merge 5 commits intomainfrom
repo-assist/fix-issue-735-named-parameter-types-a077db202825ef23
Open

[Repo Assist] Add ApiDocParameter and ApiDocReturnInfo named record types#1066
github-actions[bot] wants to merge 5 commits intomainfrom
repo-assist/fix-issue-735-named-parameter-types-a077db202825ef23

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Mar 3, 2026

🤖 This PR was created by Repo Assist, an automated AI assistant.

Closes #735

Root Cause

ApiDocMember.Parameters returned a list<{| ParameterSymbol: ...; ParameterNameText: string; ParameterType: ApiDocHtml; ParameterDocs: ApiDocHtml option |}> and ApiDocMember.ReturnInfo returned an anonymous record {| ReturnType: ...; ReturnDocs: ... |}. Anonymous records from different assemblies are not structurally compatible in F#, making it impossible for external consumers to pass these values to their own functions without pre-processing.

Fix

Added two named record types:

type ApiDocParameter =
    { ParameterSymbol: Choice(FSharpParameter, FSharpField)
      ParameterNameText: string
      ParameterType: ApiDocHtml
      ParameterDocs: ApiDocHtml option }

type ApiDocReturnInfo =
    { ReturnType: (FSharpType * ApiDocHtml) option
      ReturnDocs: ApiDocHtml option }

ApiDocMember.Parameters now returns ApiDocParameter list and ApiDocMember.ReturnInfo returns ApiDocReturnInfo.

Backwards Compatibility

All field names are identical to the anonymous record fields, so existing code using .ParameterNameText, .ParameterType, .ParameterDocs, .ReturnType, .ReturnDocs continues to work without modification. The change is additive from a usage perspective (named types are strictly more usable than anonymous records).

Test Status

  • Build: ✅ succeeded (0 warnings, 0 errors)
  • Tests: ✅ 76/76 passed, 4 skipped (pre-existing)
  • Formatting: ✅ Fantomas applied

Generated by Repo Assist for issue #735

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@da02dddebe71d9a937665abdcd1f5214dab852a7

…-assembly usability

Replace anonymous records in ApiDocMember.Parameters and ApiDocMember.ReturnInfo
with named record types ApiDocParameter and ApiDocReturnInfo. Anonymous records
from different assemblies are not structurally compatible, making these properties
difficult to consume externally.

All field names are preserved, so existing code using .ParameterNameText,
.ParameterType, .ParameterDocs, .ReturnType, .ReturnDocs continues to work
without modification.

Closes #735

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dsyme dsyme marked this pull request as ready for review March 4, 2026 09:15
@dsyme
Copy link
Contributor

dsyme commented Mar 4, 2026

/repo-assist please update README

…ocs.fsx

Document the new named record types in the 'Building library documentation
programmatically' section of docs/apidocs.fsx, showing how to access
ApiDocMember.Parameters (ApiDocParameter list) and ApiDocMember.ReturnInfo
(ApiDocReturnInfo) and how to pass them to user-defined functions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor Author

github-actions bot commented Mar 4, 2026

Commit pushed: 5934619

Generated by Repo Assist

@github-actions
Copy link
Contributor Author

github-actions bot commented Mar 4, 2026

🤖 This is an automated response from Repo Assist.

I've updated the docs as requested. Added a new "Working with API member parameters and return information" subsection to docs/apidocs.fsx under the "Building library documentation programmatically" section (da9c695).

The new section:

Generated by Repo Assist for issue #1066 ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@10f087607af87e4e89439161f1e5d4724235f396

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Is it possible to expose the ApiDocMember.Parameters using a "real" record?

1 participant