jolicode / slack-php-api

:hash: PHP Slack Client based on the official OpenAPI specification
https://jolicode.github.io/slack-php-api/
MIT License
221 stars 54 forks source link

Jane 6 upgrade #86

Closed xavierlacot closed 3 years ago

xavierlacot commented 3 years ago

Upgrade to JanePHP 6, which has been published 3 months ago. Also, added tests for the JsonSorter class.

damienalexandre commented 3 years ago

See https://jane.readthedocs.io/en/latest/components/OpenAPI.html#authentication and https://github.com/jolicode/slack-php-api/blob/master/src/ClientFactory.php#L42 :)

xavierlacot commented 3 years ago

See https://jane.readthedocs.io/en/latest/components/OpenAPI.html#authentication and https://github.com/jolicode/slack-php-api/blob/master/src/ClientFactory.php#L42 :)

The oauth2 security scheme type is not supported in Jane 6, it "only" supports apiKey and http (basic|bearer).

The only thing that we can do on this for now is patching the securityDefinitions.slackAuth spec node, in order to change its type:

{
  "type": "apiKey",
  "in": "header",
  "name": "Authorization"
}

That way, Jane would generate an Authentication class, which basically only adds the header to all requests, which is exactly what we are doing with HeaderAppendPlugin. That said, I do not see this as significant enough improvement to warrant another patch to the specification...

tecbird commented 3 years ago

+1 please merge, i use another other clients which uses already jane 6.x

xavierlacot commented 3 years ago

Any news on this topic? Are there things that need to be sorted out before a merge?

damienalexandre commented 3 years ago

Yes my comment about the bad phpdoc is still relevant.

generated/Model/FilesInfoGetResponse200.php

     /**
-     * @var mixed[]|null
+     * @var |null

I'm working with Jane Core Team to fix that up. In the meantime @tecbird you can require the client like this in your composer.json file:

"jolicode/slack-php-api": "dev-jane-6-upgrade"

It would be great if you can give us feedback too!

Cheers

xavierlacot commented 3 years ago

@damienalexandre the weird phpdoc has been fixed (thanks @Korbeil) and the tests are green :tada: (btw, the related Jane pull request is janephp/janephp#379)

damienalexandre commented 3 years ago

Thanks a lot for your hard work both @Korbeil and @xavierlacot :)

damienalexandre commented 3 years ago

Version 3.0 is released, thanks!

cc @tecbird