Skip to content

[Repo Assist] improve: enrich XML documentation for generated API methods#349

Merged
sergey-tihon merged 3 commits intomasterfrom
repo-assist/improve-xmldoc-2026-03-30-1959a272d989bfb8
Mar 31, 2026
Merged

[Repo Assist] improve: enrich XML documentation for generated API methods#349
sergey-tihon merged 3 commits intomasterfrom
repo-assist/improve-xmldoc-2026-03-30-1959a272d989bfb8

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 This is a Repo Assist automated PR.

Implements the long-standing TODO: Use description of parameters in docs comment in both v2/OperationCompiler.fs and v3/OperationCompiler.fs.

Problem

Generated API client methods had minimal XML documentation — only the OpenAPI summary field was surfaced as a plain text doc comment. The description field and individual parameter descriptions were silently discarded.

Changes

v3/OperationCompiler.fs

  • Build a structured XML doc string with proper <summary>, <remarks>, and <param> tags
  • Include <remarks> from operation.Description when it differs from Summary
  • Emit <param name="...">...</param> for each openApiParameters entry that has a description
  • Emit <param name="...">...</param> for the request body when RequestBody.Description is set
  • XML-escape all description text (&, <, >) to prevent malformed doc comments

v2/OperationCompiler.fs

  • Same structured XML doc improvement for SwaggerClientProvider-generated methods
  • Parameter descriptions are sourced from op.Parameters[].Description
  • <remarks> from op.Description when it differs from op.Summary

Before / After example

// Before: plain text, params undocumented
/// Create a pet

// After: structured XML doc with parameter details
/// <summary>Create a pet</summary>
/// <param name="body">Pet to add to the store</param>

No changes to generated runtime behaviour — only IntelliSense / XML doc output is affected.

Test Status

Unit tests: 241 passed, 0 failed
Format check (dotnet fantomas --check): passed
⚠️ Integration tests: Test server cannot start in this CI environment (pre-existing infrastructure constraint — same limitation affects all Repo Assist PRs targeting integration tests).

Generated by 🌈 Repo Assist at {run-started}. Learn more.

To install this agentic workflow, run

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

…scriptions and remarks

- Build structured XML doc (<summary>, <remarks>, <param>) instead of plain text
- Add <param name="..."> entries for OpenAPI parameters that have descriptions
- Add <remarks> for operation.Description when it differs from Summary
- Apply same improvement to both v2 (SwaggerClientProvider) and v3 (OpenApiClientProvider)
- XML-escape description text to prevent malformed doc comments
- Resolves the TODO comment that has been in the code since the initial implementation

241 unit tests pass; format check passes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sergey-tihon
Copy link
Copy Markdown
Member

/repo-assist refactor code and reuse xml generation code between v2 and v3

@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions bot commented Mar 31, 2026

✗ Repo Assist encountered failed at {run-ended}.

@sergey-tihon
Copy link
Copy Markdown
Member

@copilot refactor code and reuse xml generation code between v2 and v3

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

@copilot refactor code and reuse xml generation code between v2 and v3

Done in f7feb4c. Extracted a shared XmlDoc.buildXmlDoc function into Utils.fs that both v2/OperationCompiler.fs and v3/OperationCompiler.fs now call — no more duplicated XML escape and doc-building logic.

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:

  • petstore.swagger.io
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet /usr/share/dotnet/sdk/10.0.201/FSharp/fsc.dll @/tmp/MSBuildTemp3skjYb/tmp10aed6a5a3a3490eb8c00e08cd83a91d.rsp (dns block)

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

Copilot AI requested a review from sergey-tihon March 31, 2026 06:43
@sergey-tihon sergey-tihon reopened this Mar 31, 2026
@sergey-tihon sergey-tihon marked this pull request as ready for review March 31, 2026 08:00
Copilot AI review requested due to automatic review settings March 31, 2026 08:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the XML documentation emitted for generated API client methods (both Swagger v2 and OpenAPI v3) by converting plain summary text into structured XML docs and including operation descriptions and parameter descriptions.

Changes:

  • Add XmlDoc.buildXmlDoc helper to construct <summary>, <remarks>, and <param> tags with basic XML escaping.
  • Update v3 OperationCompiler to emit structured XML docs, including request-body and parameter descriptions.
  • Update v2 OperationCompiler to emit structured XML docs, including parameter descriptions.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/SwaggerProvider.DesignTime/v3/OperationCompiler.fs Builds XML doc fragments for generated v3 methods, including per-parameter docs and request-body docs.
src/SwaggerProvider.DesignTime/v2/OperationCompiler.fs Builds XML doc fragments for generated v2 methods, including per-parameter docs.
src/SwaggerProvider.DesignTime/Utils.fs Introduces a shared XmlDoc helper to build and escape structured XML doc fragments.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sergey-tihon sergey-tihon merged commit 6a30305 into master Mar 31, 2026
27 checks passed
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.

3 participants