Repository navigation
Feature/add v3 api namespace only - #75
Merged
Merged
Conversation
Enable v3 generation and update the generator to handle the OpenAPI 3.1 constructs the v3 spec introduced: void 200 responses (now emit void methods), union type arrays such as ["integer","string"] (normalized via primaryType), and array responses with inline scalar items (now typed as array<array-key, int>). Only the new V30 namespace is added; the existing V10-V20 namespaces are left untouched.
Filter generate.php to the v3 major version so make generate only emits the V30 namespace and leaves v1/v2 untouched. Upgrade the toolchain to PHP 8.3 (Dockerfile, CI workflows, composer require) and move the test dependencies to orchestra/testbench ^10 / phpunit ^11.5 / symfony 7, which resolves cleanly without any security advisory overrides. The remaining src changes are php-cs-fixer reformatting from the v3 ruleset.
The v3 spec declares some 200 responses as a plain string schema rather than the JSON envelope used by v1/v1.1. The generator emitted those methods returning buildResponse(), which json_decodes with JSON_THROW_ON_ERROR and threw a JsonException on the raw, non-JSON body. Add buildStringResponse() to the Request base class to return the raw body, and route string return types to it in the generator. Regenerated v3: getNotice (Company, User), createBuyOrderDelivery and processPickbons now return the raw string. v1/v2 are unaffected.
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.
No description provided.