Repository navigation
Conversation
* composer: jane-php/open-api-runtime & jane-php/open-api-2 ^8.0, symfony/http-client ^6.4|^7.0|^8.0; drop psr/*, php-http/*, nyholm/psr7
* .jane-openapi.php: default-fetch-mode => preload; generated/ rebuilt with JanePHP 8.0 (public typed model properties, no $fetch param, getFetchMode()/getTargetClass())
* src: HTTPlug plugins replaced by Symfony HttpClient decorators (SlackAuthentication + AuthenticationRegistry, SlackErrorHttpClient preserving SlackErrorResponse on {"ok": false} payloads); serve URL handled by Jane's ServerUrlHttpClient
* ClientFactory::create() expects a Symfony Contracts HttpClientInterface; iterate()/filesUploadV2() reworked accordingly; guards for uninitialized typed properties
* CI: test matrix on PHP 8.4/8.5 with prefer-lowest on 8.4 (deprecations helper disabled), setup-php for the check-spec job
* docs: quick-start, usage & changelog (5.0.0) updated
damienalexandre
left a comment
Member
There was a problem hiding this comment.
Not a big fan of the gettter/setter to property change.
Anyway it will require a new major version 👍
JanePHP 8 generates models with public natively typed properties instead of getters, like the rest of the documentation already shows. Co-authored-by: damienalexandre <damienalexandre@users.noreply.github.com>
The model-sample image showed a User dump from 2021 with the old protected property access. Take a new dump of ObjsUser matching the JanePHP 8 API, in which properties are public and natively typed.
This branch has not been deployed
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.
Description
Migrate the generated client to JanePHP 8.0.0 (released Oct 1, 2026) and configure the new
default-fetch-modegeneration option topreload.Main changes coming with JanePHP 8
getXxx()/setXxx()accessors, so the public API is now$user->nameinstead of$user->getName()(see the JanePHP 8.0.0 migration table);Symfony\Contracts\HttpClient\HttpClientInterfaceinstead of PSR-7 / PSR-18 / HTTPlug — removed thephp-http/*,psr/*andnyholm/psr7dependencies, addedsymfony/http-client ^6.4 || ^7.0 || ^8.0;getHeaders(false)/getContent(false)): documented statuses are mapped as before and undocumented ones now throwUnexpectedStatusCodeException(new upstream defaultthrow-unexpected-status-code: true);$fetchtrailing parameter /FETCH_OBJECT/FETCH_RESPONSEconstants of generated endpoints & clients are gone; raw responses stay available withexecuteRawEndpoint().Fetch mode
preloadfetch mode via'default-fetch-mode' => 'preload'in the Jane configuration file....Response200and a...Responsedefaultfallback model, so for this specification the deferred modes degrade to the same blocking runtime behavior as before (lazy ghost proxies additionally require PHP >= 8.4 and a single-model response, see JanePHP ADR 0014). The option sets the stage for future per-operationx-fetch-modetweaks in the patched specification.Custom code rework
src/HttpPlugin/*(HTTPlug plugins) removed, replaced bysrc/Http/*Symfony HttpClient decorator factories:JoliCode\Slack\Http\SlackAuthenticationimplements the new JanePHPAuthenticationPlugin(decorate()+getScope()) and is wired throughAuthenticationRegistry: it addsAuthorization: Bearer ...to the endpoints declaring theslackAuthscope;JoliCode\Slack\Http\SlackErrorHttpClientintercepts Slack{"ok": false}payloads (a 2xx HTTP status carrying an error) and throws the historicalJoliCode\Slack\Exception\SlackErrorResponsewith the error code and response metadata — the check runs lazily, on first content read, keeping it compatible with the deferred fetch modes;https://slack.com/api) is now handled by the generated code through JanePHP'sServerUrlHttpClientdecorator (absolute URLs, e.g. file uploads onhttps://files.slack.com, are forwarded untouched), so the historicalapplyServerPlugins: falseworkaround is gone;ClientFactory::create(string $token, ?HttpClientInterface $httpClient = null)now expects aSymfony\Contracts\HttpClient\HttpClientInterface, falling back toSymfony\Component\HttpClient\HttpClient::create();filesUploadV2()upload step reworked onHttpClientInterface::request()withstring|resourcebodies, andfilesize()to determine the file size;filesUpload()override signature updated (the$fetchparameter is gone upstream);fopen()/filesize()/ curl instead of the Nyholm streams).Checklist
generated/rebuilt with JanePHP 8.0.0 (the check-spec job diff-checks generation determinism)ApiTest(real Slack API) & offline tests pass.php-cs-fixer.php, also run by the generation)