Repository navigation
Add an OpenAPI SDK generator for Hypervel Saloon - #808
Conversation
Generate connectors, resources, requests and typed data objects from local OpenAPI descriptions and a PHP definition. Support customization of operation selection, authentication, pagination and response types. Expose the hypervel-sdk executable for generation, dry runs, diffs and drift checks. Track generated files in a manifest so regeneration can validate output ownership before replacing files. Register the component, executable and dependencies in Composer.
Cover description normalization, schema and operation compilation, PHP rendering, CLI behavior and output ownership. Exercise generated clients and data objects against the fixture API. Keep an example SDK under maximum-level type analysis and compare its generated files and manifest with fresh CLI output. Add the fixture autoload paths and preserve the renderer’s exact output during formatting.
Explain how to install the generator, pin OpenAPI descriptions, define an SDK and regenerate it with the CLI. Include examples of resource grouping, request bodies, authentication, pagination and testing generated clients. Link the guide from the package README and the documentation index.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
|
@cubic-dev-ai review |
@binaryfire cubic can't start this review because your workspace has reached its free monthly review limit. cubic has reviewed 164,098 of the 160,000 allowed lines of code this month. Reviews resume on 10 December 2026 (in 9 days). Paid plans include much higher monthly review limits. Upgrade now to resume reviews. To help optimise your usage, you can tune cubic to get the most out of your usage limits:
|
PR Summary by QodoAdd an OpenAPI SDK generator for Hypervel Saloon
AI Description
Merge Risk
|
Code Review by Qodo
1.
|
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge; the added naming guidance matches the generator. SummaryAdds a standalone OpenAPI SDK generator for Hypervel Saloon, with typed data objects, authentication, pagination, and guarded regeneration.
Review used source inspection. No tests were run. Reviews (3) · Last reviewed commit: "Document resource naming on a shared SDK..." · Reviewed by Greptile |
Honor each source namespace when naming models, resources, requests and paginators. Compare list arms when sharing model declarations, preserve list and object values from typed serializers, and validate discriminator tags on map-backed values. Count nullable enum arms through nested groups while retaining the enclosing nullable policy used by provider schemas. Apply stream media preferences in declaration order and check that the selected range can accept a response. Let generated connector defaults fill missing query parameters while preserving caller-supplied wire encoding, repeated values and numeric names. Serialize only the defaults that will be sent. Coordinate SDK installation across the output swap, validate the actual displaced tree, and restore it if a late edit or a competing generation changed the output. Exercise these cases and the generated contracts through the compiler and runtime tests. Align the component and analysed fixture dependency constraints, remove the unrelated YAML license notice, and give the CI formatter workers enough memory to check the expanded source tree.
|
The installer now checks the displaced tree and restores it if a file changed or another generation installed first. |
Explain how source namespaces and connector method names interact when multiple descriptions use the same resource tag. Show how a naming override scoped to the billing source exposes both resources with distinct accessors on the shared connector.
This adds
hypervel/sdk-generator, a development dependency for building typed PHP clients from OpenAPI descriptions. The generated clients use Hypervel Saloon for requests, authentication, and pagination, and Hypervel Data for request and response objects. The generator runs from the command line without booting an application.Generating a client
An SDK keeps a local copy of its OpenAPI description and a small
sdk.phpalongside its Composer manifest. The definition selects a source and the PHP namespace for the client. For example:Running
vendor/bin/hypervel-sdk generate path/to/cloudwrites the connector, resources, requests, and data objects undergenerated/. The definition can select operations, group them into resources, map provider types to application classes, and describe authentication, response handling, and pagination. Source corrections can live in the definition so the original provider description stays available for comparison.The reader accepts local JSON and YAML files in Swagger 2.0 and OpenAPI 3.0 and 3.1. It also accepts OpenAPI 3.2 descriptions that use the supported 3.1 features and the
QUERYmethod. Unsupported features in a selected operation are reported during generation.Updating a client
Handwritten classes live in
src/. A manifest ingenerated/records the inputs and hashes of the files the generator owns. Regeneration checks those hashes before replacing output, so an unexpected edit, deletion, or extra file is reported before it can be overwritten.Use
generate --dry-run --diffto inspect a provider update, orgenerate --checkin CI to detect drift without writing files.Verification
The tests cover description loading, schema and operation compilation, rendering, CLI behavior, and output ownership. A committed example SDK exercises the generated client and its PHP types. The SDK generator suite, static analysis, and formatting checks passed locally. Regenerating the example produced no changes.
Note
Add OpenAPI SDK generator for Hypervel Saloon
sdk-generatorcomponent: OpenAPI source loading (JSON/YAML, Swagger 2.0 through OpenAPI 3.2), normalization, schema compilation, and generation of Saloon connectors, requests, resources, DTOs, enums, forms, authentication, OAuth, pagination, and wire helpers from anSdkDefinitionfilehypervel-sdkCLI (generatecommand) with--dry-run,--diff,--check, and--onlyoptions, backed by a stagedOutputManagerthat validates prior manifest ownership before replacing generated outputSdkDefinition,OpenApiSource,TypeMapping,Authentication,Pagination, and others) that validate and freeze into immutable configurationsAnalysedSdkfixture used for end-to-end and PHPStan type checksConnector::prefersUrlQuery()(default false) andUrlResolver::withQuery()change query merging so existing URL query pairs can win over connector defaults for designated fallback keys;withQueryParametersnow replaces matching keys instead of appendingSdkGenerator::generate()reads$previousManifestbefore assigning it, causing an undefined-variable warning and a null value passed tostage()in SdkGenerator.phpMacroscope summarized efb019d.