Repository navigation
perf(openapi): drop debug logging from RelationFieldSchemaDecorator - #24
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RelationFieldSchemaDecoratorwrotedebuglog 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 twocatch (\Exception $e)clauses becomecatch (\Exception)because the variable is no longer used. Both catch paths keep their behaviour.config/services.yamland the configuration tree are unchanged. The logger is still injected and passed on toRelationLabelPropertyResolver(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 withoutproperties, rootproperties, class without Doctrine metadata, iri-reference without association, target that is no API resource, resource without operations, resource withoutGetCollection), asserts zerodebugrecords and pins the generatedx-*extensions.CHANGELOG.md: section0.8.1.Verification
0.8.0(6 failures, all on the debug-record assertion) and passes after the removal.debugcall put back intogetRelationExtensions()makes the test fail again (5 of 6 tests; the sixth never reaches that method).Not in this PR
dmstr/openapi-json-schema-bundle(JsonFieldSchemaDecorator); it is tracked in a follow-up issue there.Release: patch
0.8.1.Part of #14
🤖 Generated with Claude Code