Skip to content

[ADMINAPI-1435] Update the OpenAPI action - #418

Merged
jagudelo-gap merged 15 commits into
mainfrom
ADMINAPI-1435
Aug 4, 2026
Merged

[ADMINAPI-1435] Update the OpenAPI action#418
jagudelo-gap merged 15 commits into
mainfrom
ADMINAPI-1435

Conversation

@jagudelo-gap

@jagudelo-gap jagudelo-gap commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces several improvements to OpenAPI documentation generation, enhances endpoint response metadata, and refines the workflow for generating OpenAPI specs. The most significant changes are the addition of new Swashbuckle operation filters to improve OpenAPI accuracy, updates to endpoint response conventions (especially for 201 responses), and workflow improvements for OpenAPI artifact generation.

OpenAPI Documentation Improvements

  • Added three custom Swashbuckle operation filters:
    • LocationHeaderOperationFilter documents the "Location" header on 201 responses, allowing for endpoint-specific descriptions via new metadata.
    • AnonymousOperationSecurityFilter ensures endpoints allowing anonymous access do not require OAuth in the generated spec.
    • ProblemDetailsResponseOperationFilter documents the application/problem+json error response for all 4xx/5xx responses.
  • Registered these filters in OpenAPI configuration in WebApplicationBuilderExtensions.cs.

Endpoint Response Metadata Enhancements

  • Extended WithResponseCode and WithResponse<T> to accept an optional locationDescription parameter, and added LocationHeaderDescriptionMetadata to support custom "Location" header descriptions for 201 responses. [1] [2]
  • Updated V2 and V3 education organization refresh endpoints to use the new response conventions, providing accurate descriptions for the "Location" header. [1] [2] [3] [4]
  • Added explicit 200-response documentation for tenant endpoints. [1] [2]

OpenAPI Generation Workflow Improvements

  • Updated .github/workflows/openapi-md.yml to:
    • Allow scheduled and manual workflow runs with flexible version/branch selection.
    • Upgrade Swashbuckle.AspNetCore.Cli to version 7.1.0.
    • Generate and upload OpenAPI YAML artifacts instead of committing them directly.

Code Quality and Consistency

  • Extracted job queued responses into a named class (JobQueuedResult) for clarity and type safety. [1] [2] [3]

Security and Configuration

  • Minor update to use the correct scope constant for OAuth security definition.

Tested on

https://github.com/jagudelo-gap/ODS-Admin-API/actions/runs/30849728697

jagudelo-gap and others added 15 commits July 30, 2026 18:05
Documents the plan to fix build.ps1's v2-only OpenAPI export, drop widdershins
markdown generation, and replace the branch/PR flow in openapi-md.yml with a
manually-dispatchable + weekly-scheduled workflow that publishes v2/v3 yaml
specs as run artifacts instead of committing anywhere.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Two-task plan covering build.ps1 fixes (v2+v3 generation, widdershins
removal, command rename) and the openapi-md.yml rewrite (optional version
input with latest fallback, weekly schedule, artifact upload instead of
branch/commit/PR).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ion bump, ref-based checkout

- v2 and v3 docs must be generated from two separate build/run passes with
  AdminApiMode flipped between them, since it gates which endpoints the app
  registers at startup - a single static build can only produce one correct
  doc.
- Swashbuckle.AspNetCore.Cli bumped 6.6.2 -> 10.2.3 (6.6.2 predates .NET 10
  support).
- workflow_dispatch version input now resolves to a git ref (semver -> vX.Y.Z
  tag, raw string -> branch/ref as-is, blank -> main) instead of always
  building whatever triggered the dispatch, restoring the original intent of
  targeting a specific released version. Documented as forward-only: only
  works for refs created after this change merges.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@jagudelo-gap
jagudelo-gap requested a review from a team as a code owner August 3, 2026 20:29
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Test Results

   15 files     15 suites   1m 9s ⏱️
1 815 tests 1 801 ✅ 14 💤 0 ❌
4 267 runs  4 229 ✅ 38 💤 0 ❌

Results for commit 3523a12.

@jagudelo-gap
jagudelo-gap merged commit 58a02fa into main Aug 4, 2026
28 checks passed
@jagudelo-gap
jagudelo-gap deleted the ADMINAPI-1435 branch August 4, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants