Skip to content

6869: Improve OpenAPI spec with descriptions, examples, and error codes#64

Open
turegjorup wants to merge 1 commit intofeature/6869_agent_configfrom
feature/api-spec-updates
Open

6869: Improve OpenAPI spec with descriptions, examples, and error codes#64
turegjorup wants to merge 1 commit intofeature/6869_agent_configfrom
feature/api-spec-updates

Conversation

@turegjorup
Copy link
Copy Markdown
Contributor

Summary

  • Add API title, description, and version to the OpenAPI spec via api_platform.yaml
  • Add operation-level summary, description, and error responses (401, 403) to the POST /api/detection_results endpoint
  • Add field-level descriptions, examples, and enum (referencing DetectionType constants) for type, rootDir, and data
  • Add OpenApiFactory decorator for dynamic server URL (from COMPOSE_SERVER_DOMAIN/COMPOSE_DOMAIN) and security scheme description documenting the Apikey header format
  • Regenerate api-spec-v1.yaml and api-spec-v1.json

Test plan

  • Verify composer update-api-spec regenerates identical spec files
  • Verify Swagger UI at /api/docs renders descriptions, examples, and enum values
  • Verify CI api-spec check passes
  • Verify coding standards and tests pass

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 27, 2026

API Specification - Breaking changes detected

API Changelog 0.0.0 vs. 1.0.0

API Changes

POST /api/detection_results

  • ⚠️ request property 'type' was restricted to a list of enum values (media type: application/ld+json)
  • ⚠️ request property 'type' was restricted to a list of enum values (media type: application/json)
  • ⚠️ the 'type' request property type/format changed from 'string'/'' to ''/'' (media type: application/ld+json)
  • ⚠️ the 'type' request property type/format changed from 'string'/'' to ''/'' (media type: application/json)
  • the 'type' request property default value '' was removed (media type: application/json)
  • the 'type' request property default value '' was removed (media type: application/ld+json)
  • added the new 'dir' enum value to the request property 'type' (media type: application/ld+json)
  • added the new 'dir' enum value to the request property 'type' (media type: application/json)
  • added the new 'docker' enum value to the request property 'type' (media type: application/json)
  • added the new 'docker' enum value to the request property 'type' (media type: application/ld+json)
  • added the new 'drupal' enum value to the request property 'type' (media type: application/ld+json)
  • added the new 'drupal' enum value to the request property 'type' (media type: application/json)
  • added the new 'git' enum value to the request property 'type' (media type: application/ld+json)
  • added the new 'git' enum value to the request property 'type' (media type: application/json)
  • added the new 'nginx' enum value to the request property 'type' (media type: application/json)
  • added the new 'nginx' enum value to the request property 'type' (media type: application/ld+json)
  • added the new 'symfony' enum value to the request property 'type' (media type: application/json)
  • added the new 'symfony' enum value to the request property 'type' (media type: application/ld+json)
  • added the non-success response with the status '401'
  • added the non-success response with the status '403'

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 27, 2026

Codecov Report

❌ Patch coverage is 10.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 12.60%. Comparing base (bac1888) to head (7fd86a6).

Files with missing lines Patch % Lines
src/OpenApi/OpenApiFactory.php 10.00% 9 Missing ⚠️
Additional details and impacted files
@@                       Coverage Diff                       @@
##             feature/6869_agent_config      #64      +/-   ##
===============================================================
- Coverage                        12.61%   12.60%   -0.02%     
- Complexity                         819      827       +8     
===============================================================
  Files                              118      119       +1     
  Lines                             2560     2570      +10     
===============================================================
+ Hits                               323      324       +1     
- Misses                            2237     2246       +9     
Flag Coverage Δ
unittests 12.60% <10.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Add proper documentation to the auto-generated OpenAPI spec:
- API title, description, and version in api_platform.yaml
- Operation summary and description for the POST endpoint
- Field-level descriptions, examples, and enum for DetectionResult
- 401/403 error responses for authentication/authorization failures
- Server URL from COMPOSE_SERVER_DOMAIN/COMPOSE_DOMAIN env vars
- Security scheme description documenting the Apikey header format

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@turegjorup turegjorup force-pushed the feature/api-spec-updates branch from 168da31 to 7fd86a6 Compare March 27, 2026 12:21
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