feat: add Builder as unified entry point#2044
Merged
Merged
Conversation
b4276fa to
23e8f7a
Compare
Introduces Builder with withGenerator() escape hatch for classic mode configuration, and Builder\Result with collected validation log entries. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate GenerateCommand to use Builder with withGenerator() hook for processor/config customization. Add saveAs() to Result for file output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace direct Generator usage with Builder in ExamplesTest, ScratchTest, ContextTest, AugmentParametersTest, and CleanUnusedComponentsPerformanceTest. Add Result::openApi() accessor for tests that need the underlying annotation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The CLI command sets its own ConsoleLogger explicitly, so this only affects programmatic usage where silent-by-default is preferred. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Prepares for spec pipeline integration. Only 'classic' is functional; other modes throw OpenApiException until implemented. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
043f798 to
84d67ef
Compare
84d67ef to
7d5efcc
Compare
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.
Introduction
With the planned introduction of a new, simpler set of attributes to replace the current
OpenApi\Attributesclasses it became clear that the currentGeneratorclass is not compatible with the new processing chain.For this reason a new
Builderclass has been created that unifies access to both the current (classic) annotations and attributes and the future new set (spec) which will live inOpenApi\Spec.Timeline
Builderto toggle between the two.classiccode is not changed at all and keeps working.specsystem evolves until it hits feature paritit withclassic(or beyond),classicis the default in theBuilderclass.hybridmode planned that will route allclassicannotations/attributes through the newspecprocessing chain.classiccode is marked deprecated.Builderis switched to 'spec'.classiccode is removed andspecbecomes the sole set of attributes.@OAdocblock annotations are no longer supported at all.Summary
Builderclass as the recommended entry point for generating OpenAPI specsGenerateCommandto use Builder internallyBuilderwhere appropriatemodeoption added to the CLI to toggle betweenclassic(the current system) andspec- the new attributes (once they are implemented)Related to #1953