Skip to content

Default User-Agent to versioned zernio-php/<version>/PHP#4

Open
Ooscaar wants to merge 1 commit into
mainfrom
user-agent-version
Open

Default User-Agent to versioned zernio-php/<version>/PHP#4
Ooscaar wants to merge 1 commit into
mainfrom
user-agent-version

Conversation

@Ooscaar
Copy link
Copy Markdown
Member

@Ooscaar Ooscaar commented May 26, 2026

Summary

  • Lazily resolves the default User-Agent from composer.json the first time Configuration::getUserAgent() is called, producing zernio-php/<composer-version>/PHP instead of the static OpenAPI-Generator/1.0.0/PHP.
  • Re-applies the patch in .github/workflows/generate.yml after each openapi-generator-cli generate, so the change survives every regeneration without depending on knowing the next version bump at generation time.
  • Behavior preserved for callers that set their own UA via setUserAgent().

Test plan

  • php -l lib/Configuration.php — no syntax errors
  • Smoke test: new Configuration().getUserAgent() returns zernio-php/0.0.293/PHP and setUserAgent('custom/1.0') still overrides
  • ./vendor/bin/phpunit (with memory_limit=512M) — all 6011 generated tests pass (same Incomplete status as on main)
  • Workflow patch script verified against an original-shape Configuration.php — both regexes match exactly once

🤖 Generated with Claude Code

Replace the static OpenAPI-Generator default with a lazy resolver that
reads composer.json once at first use, so requests carry the SDK
version. The generate.yml workflow re-applies the patch after each
regeneration.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant