Skip to content

feat: add Builder as unified entry point#2044

Merged
DerManoMann merged 8 commits into
zircote:masterfrom
DerManoMann:openapi-builder
Jul 12, 2026
Merged

feat: add Builder as unified entry point#2044
DerManoMann merged 8 commits into
zircote:masterfrom
DerManoMann:openapi-builder

Conversation

@DerManoMann

@DerManoMann DerManoMann commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Introduction

With the planned introduction of a new, simpler set of attributes to replace the current OpenApi\Attributes classes it became clear that the current Generator class is not compatible with the new processing chain.
For this reason a new Builder class has been created that unifies access to both the current (classic) annotations and attributes and the future new set (spec) which will live in OpenApi\Spec.

Timeline

  • v6
    • The new attributes are added and support added to the Builder to toggle between the two.
    • The current/classic code is not changed at all and keeps working.
    • The new spec system evolves until it hits feature paritit with classic (or beyond), classic is the default in the Builder class.
    • There is also a new hybrid mode planned that will route all classic annotations/attributes through the new spec processing chain.
  • v7
    • All classic code is marked deprecated.
    • The default in Builder is switched to 'spec'.
  • v8:
    • All classic code is removed and spec becomes the sole set of attributes.
    • classic @OA docblock annotations are no longer supported at all.

Summary

  • Introduce Builder class as the recommended entry point for generating OpenAPI specs
  • Migrate CLI GenerateCommand to use Builder internally
  • Add docs: reference page, generating guide updated, sidebar entry
  • Tests updated to use Builder where appropriate
  • mode option added to the CLI to toggle between classic (the current system) and spec - the new attributes (once they are implemented)

Related to #1953

@DerManoMann DerManoMann force-pushed the openapi-builder branch 4 times, most recently from b4276fa to 23e8f7a Compare July 9, 2026 07:56
DerManoMann and others added 6 commits July 12, 2026 13:22
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>
@DerManoMann DerManoMann force-pushed the openapi-builder branch 2 times, most recently from 043f798 to 84d67ef Compare July 12, 2026 03:27
@DerManoMann DerManoMann merged commit d200624 into zircote:master Jul 12, 2026
18 checks passed
@DerManoMann DerManoMann deleted the openapi-builder branch July 12, 2026 03:44
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