Skip to content

perf(openapi): drop debug logging from RelationFieldSchemaDecorator - #24

Merged
schmunk42 merged 3 commits into
masterfrom
feature/utils-debug-logging
Nov 26, 2026
Merged

schmunk42 merged 3 commits into
masterfrom
feature/utils-debug-logging

Conversation

@schmunk42

Copy link
Copy Markdown
Member

Summary

RelationFieldSchemaDecorator wrote debug log records on every schema build: one per call, several per definition and several per property. This PR removes all 23 calls. Only the log output changes.

Changes

  • src/OpenApi/RelationFieldSchemaDecorator.php: all $this->logger->debug(...) calls removed; the two catch (\Exception $e) clauses become catch (\Exception) because the variable is no longer used. Both catch paths keep their behaviour.
  • Constructor, config/services.yaml and the configuration tree are unchanged. The logger is still injected and passed on to RelationLabelPropertyResolver (its "Failed to infer label property" warning is untouched).
  • tests/OpenApi/RelationFieldSchemaDecoratorLoggingTest.php: new regression test with a recording PSR-3 logger. It covers every former logging path (input and output schema, definitions with and without properties, root properties, class without Doctrine metadata, iri-reference without association, target that is no API resource, resource without operations, resource without GetCollection), asserts zero debug records and pins the generated x-* extensions.
  • CHANGELOG.md: section 0.8.1.

Verification

  • The new test fails on 0.8.0 (6 failures, all on the debug-record assertion) and passes after the removal.
  • Mutation check: one debug call put back into getRelationExtensions() makes the test fail again (5 of 6 tests; the sixth never reaches that method).
  • Full suite: 258 tests, 790 assertions, green (252 tests before).

Not in this PR

Release: patch 0.8.1.

Part of #14

🤖 Generated with Claude Code

schmunk42 and others added 3 commits November 26, 2026 16:25
…ords [*]

Adds a regression test with a recording PSR-3 logger that covers every
logging path of the decorator (input and output schema, definitions with
and without properties, root properties, missing Doctrine metadata,
iri-reference without association, non-resource targets, resources
without operations or without GetCollection) and pins the generated
x-* extensions. The test fails until the debug calls are removed.

Part of #14

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Removes all 23 debug records the decorator wrote per schema build, per
definition and per property. The two catch clauses lose their unused
exception variable. Constructor, services, configuration and the
generated schemas are unchanged; the logger is still passed on to
RelationLabelPropertyResolver.

Part of #14

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Part of #14

Co-Authored-By: Claude Fable 5.2 <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