[Repo Assist] improve: surface enum allowed-values in operation parameter XmlDocs (+3 tests, 324→327)#398
Merged
sergey-tihon merged 3 commits intomasterfrom Apr 24, 2026
Conversation
…+3 tests, 324→327) Extract the enum-value formatter from DefinitionCompiler into a shared XmlDoc.buildEnumDoc helper in Utils.fs, then use it in both places: - DefinitionCompiler already added 'Allowed values: ...' to object property XmlDocs; this PR refactors the local formatEnumValue function out to the shared module (no behaviour change for properties). - OperationCompiler now also adds enum value hints to the <param> tags in generated method XmlDocs, so IntelliSense shows valid values for query/path/header/cookie parameters that have an enum schema. Before: /// <summary>List items</summary> /// <param name="status">Filter by status</param> After: /// <summary>List items</summary> /// <param name="status">Filter by status /// Allowed values: active, inactive, pending</param> Also refactors Schema.XmlDocTests.fs: extract parseSchema / getXmlDocAttr helpers to eliminate duplication and add a getMethodXmlDoc helper used by 3 new tests covering the operation-parameter enum doc feature. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Surfaces OpenAPI enum allowed-values as an “Allowed values: …” hint in generated IntelliSense XML docs for operation parameters, aligning with existing behavior for schema properties.
Changes:
- Extracted a shared
XmlDoc.buildEnumDochelper to format enum value lists. - Reused
XmlDoc.buildEnumDocfor schema property XmlDocs (no intended behavior change). - Appended enum allowed-values to operation parameter descriptions in
OperationCompiler, with 3 new tests covering the new behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tests/SwaggerProvider.Tests/Schema.XmlDocTests.fs |
Refactors schema parsing / XmlDoc extraction helpers and adds tests validating enum hints in method <param> docs. |
src/SwaggerProvider.DesignTime/Utils.fs |
Introduces XmlDoc.buildEnumDoc to format enum values consistently across compilers. |
src/SwaggerProvider.DesignTime/OperationCompiler.fs |
Adds enum allowed-values into operation parameter XmlDoc content via buildParamDesc. |
src/SwaggerProvider.DesignTime/DefinitionCompiler.fs |
Replaces inline enum doc formatting with the shared XmlDoc.buildEnumDoc helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
OpenAPI parameters with
enumvalues (query, path, header, cookie) now include an "Allowed values: ..." hint in their IntelliSense<param>tag, consistent with what already happens for object properties.Before
Format check: ✅
fantomas --checkpasses on all changed files.