Fix OpenAPI review issues

Merged
ME
5mo ago
+13-14

Summary

Fixes all valid findings from inline code review:

  • Relative server URL — Replace https://example.com/api/v1 and http://localhost/api/v1 with /api/v1 so generated clients point at the hosting app
  • OAS 3.1 nullable — nullable: true is removed in OpenAPI 3.1; fix OptionField.default → type: ['string','null'] and Conversion.result_file → anyOf: [$ref File, type null]
  • Dynamic curl URLs — Replace hardcoded https://example.com/api/v1/... with {{ url('/api/v1/...') }} across all 6 curl examples
  • Pinned Redoc CDN — Change /latest/ to /2.x/ to avoid silent breakage on major version releases

Skipped nitpick: @throws docblock on openApiSpec() — test helpers intentionally let exceptions bubble; no documentation value.

Test plan

  • composer test passes (620 tests)
  • composer lint passes
  • npm run build passes
  • No nullable keyword remains in openapi.yaml

🤖 Generated with Claude Code


Summary by cubic

Aligns the OpenAPI spec and docs with OAS 3.1 and the current host. Fixes client generation issues and prevents breakage in example commands and docs rendering.

  • Bug Fixes
    • Use relative server URL /api/v1 so generated clients target the hosting app.
    • Replace OAS 3.0 nullable with OAS 3.1 unions:
      • OptionField.default → type: ['string','null']
      • Conversion.result_file → anyOf: [File, null]
    • Make curl examples dynamic via {{ url('/api/v1/...') }} instead of hardcoded https://example.com.
    • Pin the ReDoc CDN from /latest/ to /2.x/ to avoid breaking changes on major releases.