[Repo Assist] improve: surface schema description as XmlDoc on generated object and enum types (+5 tests, 348→353)#419
Merged
sergey-tihon merged 4 commits intoMay 2, 2026
Conversation
… enum types (+5 tests, 348->353) When an OpenAPI component schema has a top-level `description` field, the generated ProvidedTypeDefinition (both object types and CLI enum types) now gets that description as a TypeProviderXmlDocAttribute. This means IDE tooling (IntelliSense / F# tooltips) will show the schema description when hovering over a generated type, matching the existing behaviour for property and operation-method descriptions. Changes: - DefinitionCompiler.fs: call `AddXmlDoc` on generated object types and named enum types when `schemaObj.Description` is non-null/non-whitespace - Schema.XmlDocTests.fs: 5 new Fact tests covering both object types and enum types with and without descriptions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds missing type-level XmlDoc generation so top-level OpenAPI schema description fields surface in IDE tooltips for generated object and named enum types, aligning type tooltips with existing member-level XmlDoc behavior.
Changes:
- Add
AddXmlDocfor generated object types whenschemaObj.Descriptionis present. - Add
AddXmlDocfor generated top-level named enum types (string/int) whenschemaObj.Descriptionis present. - Add 5 tests validating XmlDoc presence/absence on generated types.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/SwaggerProvider.DesignTime/DefinitionCompiler.fs |
Attaches schema description as XmlDoc on generated object and named enum types. |
tests/SwaggerProvider.Tests/Schema.XmlDocTests.fs |
Adds coverage ensuring type-level XmlDoc is emitted only when descriptions exist. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Member
|
@copilot fix formatting and build |
Agent-Logs-Url: https://github.com/fsprojects/SwaggerProvider/sessions/1b744b0e-5d19-4ea2-b95e-23dfe2a564d7 Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com>
Contributor
github-actions Bot
added a commit
that referenced
this pull request
May 3, 2026
Documents improvements since beta03: - surface schema description as XmlDoc on generated types (#419) - add <returns> XmlDoc tag for operation response descriptions - eng: bump Microsoft.OpenApi and YamlReader 2.7.4 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced May 3, 2026
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
Properties and operation methods already carry
TypeProviderXmlDocAttributefrom their schemadescriptionfields, giving IDE tooltips for individual members. However, the generated types themselves (object types and CLI enum types) did not receive any XmlDoc — even when the component schema had a top-leveldescription.This PR adds that missing step:
ProvidedTypeDefinition, callAddXmlDocwhenschemaObj.Descriptionis non-null/non-whitespace.SetEnumUnderlyingType.Example