Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PHP OAS templates #55

Closed
wants to merge 4 commits into from
Closed

Update PHP OAS templates #55

wants to merge 4 commits into from

Conversation

davekiss
Copy link

@davekiss davekiss commented Apr 6, 2022

Process to follow for updating PHP OAS templates with upstream:

  1. Update gen/package.json and gen/openapitools.json with new generator versions
  2. yarn install
  3. cd ./gen && make template-diff
  4. mv ./tmp/template-changes.diff ./template-changes.diff
  5. patch -s -p0 < template-changes.diff
  6. git add -p ./gen/templates
  7. Update any new or changed generator-config.json values. Valid values can be seen by running openapi-generator config-help -g php

Templates

These will get pulled in automatically when you run make template-diff in step 3 above. They'll be saved in gen/tmp/oas-base-templates. However, they're available for manual inspection/git blame/sanity check here: https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources/php

Testing

  1. Pull this branch
  2. check out muxinc/openapi-specification
  3. build that (yarn && yarn validate:full)
  4. check out the SDK
  5. run OAS_SPEC_PATH=~/path/to/openapi-specification/dist/spec.json make -C ./gen build
  6. view the diff on the new sdk build
  7. MUX_TOKEN_ID=xxxxxMUX_TOKEN_SECRET=xxxxx ./test.sh

Notes:

Fixes

#45
#54

@davekiss davekiss requested review from eropple and jaredsmith April 6, 2022 18:29
@davekiss davekiss requested a review from blairliikala April 6, 2022 19:43
@jaredsmith
Copy link
Contributor

With PHP 8.1.2, running the above Testing steps, I get the following error:

========== Running ./examples/video/exercise-assets.php ==========
PHP Fatal error:  Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, MuxPhp\Models\CreateAssetRequest given in /Users/jsmith/Working/Git/mux-php/MuxPhp/Api/AssetsApi.php:327
Stack trace:
#0 /Users/jsmith/Working/Git/mux-php/MuxPhp/Api/AssetsApi.php(327): array_key_exists('create_asset_re...', Object(MuxPhp\Models\CreateAssetRequest))
#1 /Users/jsmith/Working/Git/mux-php/MuxPhp/Api/AssetsApi.php(153): MuxPhp\Api\AssetsApi->createAssetRequest(Object(MuxPhp\Models\CreateAssetRequest))
#2 /Users/jsmith/Working/Git/mux-php/MuxPhp/Api/AssetsApi.php(134): MuxPhp\Api\AssetsApi->createAssetWithHttpInfo(Object(MuxPhp\Models\CreateAssetRequest))
#3 /Users/jsmith/Working/Git/mux-php/examples/video/exercise-assets.php(26): MuxPhp\Api\AssetsApi->createAsset(Object(MuxPhp\Models\CreateAssetRequest))
#4 {main}
  thrown in /Users/jsmith/Working/Git/mux-php/MuxPhp/Api/AssetsApi.php on line 327

Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, MuxPhp\Models\CreateAssetRequest given in /Users/jsmith/Working/Git/mux-php/MuxPhp/Api/AssetsApi.php:327
Stack trace:
#0 /Users/jsmith/Working/Git/mux-php/MuxPhp/Api/AssetsApi.php(327): array_key_exists('create_asset_re...', Object(MuxPhp\Models\CreateAssetRequest))
#1 /Users/jsmith/Working/Git/mux-php/MuxPhp/Api/AssetsApi.php(153): MuxPhp\Api\AssetsApi->createAssetRequest(Object(MuxPhp\Models\CreateAssetRequest))
#2 /Users/jsmith/Working/Git/mux-php/MuxPhp/Api/AssetsApi.php(134): MuxPhp\Api\AssetsApi->createAssetWithHttpInfo(Object(MuxPhp\Models\CreateAssetRequest))
#3 /Users/jsmith/Working/Git/mux-php/examples/video/exercise-assets.php(26): MuxPhp\Api\AssetsApi->createAsset(Object(MuxPhp\Models\CreateAssetRequest))
#4 {main}
  thrown in /Users/jsmith/Working/Git/mux-php/MuxPhp/Api/AssetsApi.php on line 327

@jaredsmith
Copy link
Contributor

I think we can safely close this PR now. I tested the 6.0.0-beta generator on Friday, and it is still broken.

@jaredsmith jaredsmith closed this May 10, 2022
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.

2 participants