Skip to content

Add framework-service-documentation plugin with OpenAPI spec generation - #1

Merged
andrewsauder merged 2 commits into
mainfrom
claude/gcgov-framework-docs-tk1ny6
Jul 14, 2026
Merged

andrewsauder merged 2 commits into
mainfrom
claude/gcgov-framework-docs-tk1ny6

Conversation

@andrewsauder

Copy link
Copy Markdown
Member

Summary

Introduces a new framework service plugin that generates OpenAPI (Swagger) YAML documentation on demand by scanning application and framework source code for OpenAPI annotations.

Changes

  • New plugin: gcgov/framework-service-documentation that adds a single GET /documentation.yaml route
  • Documentation generation: Scans app source and framework internals for swagger-php annotations (@OA\* attributes) and generates a live OpenAPI spec
  • Smart scanning: Includes app directory and framework's controllers/, exceptions/, models/, and services/ directories while excluding vendor/
  • Direct YAML output: Streams raw YAML directly to client (sanctioned exception to framework's controller response pattern)
  • Developer guide: Comprehensive CLAUDE.md documenting plugin architecture, installation, route registration, generation logic, and annotation patterns for documenting APIs

Implementation Details

  • Depends on zircote/swagger-php (^6.1) and doctrine/annotations
  • Uses OpenApi\Generator with OpenApi\SourceFinder for intelligent source scanning
  • Deliberately calls die() after output to bypass normal framework response handling (documented exception)
  • Includes guards for framework path variations between path-repo and Packagist installations
  • Provides examples referencing existing plugins (user-crud, oauth-server) for annotation patterns

https://claude.ai/code/session_01VHMzRj65pSTe2yv6f9UAs8

claude added 2 commits July 14, 2026 15:15
OpenAPI documentation plugin: the /documentation.yaml route, how swagger-php scans \app and framework src, and how to annotate controllers/models so they appear in the spec.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHMzRj65pSTe2yv6f9UAs8
CI failed at composer install because the `repositories` path pointed to a
Windows-only absolute path (c:/inetpub/www/packages/framework), which is a
fatal error on the Linux runner.

- composer.json: replace that path repo with an optional sibling glob
  ("../framework*", symlink). When a framework checkout exists as a sibling
  it is used for local development; otherwise (CI and normal installs) the
  glob matches nothing and gcgov/framework:dev-main resolves from Packagist.
- ci.yml: bump the PHP matrix to ['8.3', '8.4'] because framework dev-main
  requires php >=8.3 (the 8.1/8.2 legs could never install it).
- ci.yml: enable required PHP extensions (mongodb, sodium, fileinfo, pdo) so the framework
  dependency satisfies its platform requirements at install time.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VHMzRj65pSTe2yv6f9UAs8
@andrewsauder
andrewsauder merged commit 03a0258 into main Jul 14, 2026
4 checks passed
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.

2 participants