Skip to content

Add description and documentation support to API Definition endpoint#25022

Merged
maliming merged 6 commits into
abpframework:devfrom
tntwist:add-documentation-and-description
Mar 10, 2026
Merged

Add description and documentation support to API Definition endpoint#25022
maliming merged 6 commits into
abpframework:devfrom
tntwist:add-documentation-and-description

Conversation

@tntwist

@tntwist tntwist commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Description

The API definition endpoint provides metadata about available endpoints, DTOs, and types, but lacks any description or documentation information. Users who need summaries, remarks, display names or descriptions currently have to fall back to the OpenAPI specification. This change brings that information directly into the ABP API definition model, making it available to dynamic proxy generators, code generators, and API explorers without requiring an OpenAPI dependency.

Checklist

  • [x ] I fully tested it as developer / designer and created unit / integration tests
  • I documented it (or no need to document or I will create a separate documentation issue)

How to test it?

Usage

Default — no descriptions (backward compatible, dont overbloat if not documentation not required.)

GET /api/abp/api-definition

With descriptions

GET /api/abp/api-definition?includeDescriptions=true

With descriptions and type information

GET /api/abp/api-definition?includeDescriptions=true&includeTypes=true

  • 13 new tests in AbpApiDefinitionController_Description_Tests cover:
    • Default request returns null for all description properties
    • IncludeDescriptions=true populates controller Summary, Remarks, Description, DisplayName
    • IncludeDescriptions=true populates action descriptions and return value summary
    • IncludeDescriptions=true populates parameter summaries (both ParametersOnMethod and Parameters)
    • IncludeDescriptions=true + IncludeTypes=true populates type and property descriptions
    • IncludeTypes=true without IncludeDescriptions does not populate type descriptions
    • Actions/controllers without XML docs or attributes correctly return null

Copilot AI review requested due to automatic review settings March 5, 2026 13:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds optional description/documentation data to ABP’s API Definition endpoint so consumers (proxy/code generators, API explorers) can access summaries/remarks/display metadata without relying on OpenAPI.

Changes:

  • Extends API definition models (controllers/actions/parameters/return values/types/properties) with documentation-related fields.
  • Introduces includeDescriptions request flag and XML-doc extraction via IXmlDocumentationProvider / XmlDocumentationProvider.
  • Adds integration test coverage plus a documented test app service/DTO and enables XML doc generation for the test app.

Reviewed changes

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

Show a summary per file
File Description
framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/IDocumentedAppService.cs Adds a documented test app service contract with XML docs for extraction tests.
framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/Dto/DocumentedDto.cs Adds a documented DTO with XML docs + Description/Display attributes for type/property description tests.
framework/test/Volo.Abp.TestApp/Volo/Abp/TestApp/Application/DocumentedAppService.cs Adds a documented app service implementation used by API definition integration tests.
framework/test/Volo.Abp.TestApp/Volo.Abp.TestApp.csproj Enables XML documentation file generation for the test app assembly.
framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ApiExploring/AbpApiDefinitionController_Description_Tests.cs Adds tests validating default behavior vs includeDescriptions and interaction with includeTypes.
framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/TypeApiDescriptionModel.cs Adds Summary/Remarks/Description/DisplayName fields to type modeling.
framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ReturnValueApiDescriptionModel.cs Adds return value Summary support.
framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/PropertyApiDescriptionModel.cs Adds Summary/Description/DisplayName fields to property modeling.
framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ParameterApiDescriptionModel.cs Adds Summary/Description/DisplayName fields to parameter modeling.
framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/MethodParameterApiDescriptionModel.cs Adds Summary/Description/DisplayName fields to method parameter modeling.
framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ControllerApiDescriptionModel.cs Adds controller documentation fields and includes them in sub-model creation.
framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ApplicationApiDescriptionModelRequestDto.cs Adds IncludeDescriptions request flag.
framework/src/Volo.Abp.Http/Volo/Abp/Http/Modeling/ActionApiDescriptionModel.cs Adds action documentation fields.
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/AspNetCoreApiDescriptionModelProvider.cs Populates descriptions based on XML docs and attributes; wires includeDescriptions and type/property enrichment.
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApiExploring/XmlDocumentationProvider.cs New XML documentation reader with per-assembly caching.
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApiExploring/IXmlDocumentationProvider.cs New abstraction for XML doc extraction.

You can also share your feedback on Copilot code review. Take the survey.

@tntwist

tntwist commented Mar 5, 2026

Copy link
Copy Markdown
Contributor Author

The pr build and test failed to to flaky sqlite tests.
Regarding copilot comments:
They all seem usefull, but I leave this up to the maintainers to decide to further enhance this and accept thise.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

@maliming

Copy link
Copy Markdown
Member

@tntwist Thank you for your contribution. 👍

@maliming maliming merged commit b5ec649 into abpframework:dev Mar 10, 2026
2 checks passed
@tntwist

tntwist commented Mar 10, 2026

Copy link
Copy Markdown
Contributor Author

@tntwist Thank you for your contribution. 👍

Thank you for further enhancing this feature!

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