When trying to generate a REST file using the command APP_ENV=dev composer run codegen -- --table example_crud rest --save or APP_ENV=dev composer run codegen -- --table example_crud all --save, the application is throwing an error indicating that the JwtContext class cannot be found.
The reason for this error is that the import registered in the file is named Jwt instead of JwtContext.
Steps to reproduce
Create an aplication
composer -sdev create-project byjg/rest-reference-architecture ~/tutorial master
Generate the file
APP_ENV=dev composer run codegen -- --table example_crud rest --save or
APP_ENV=dev composer run codegen -- --table example_crud all --save
Observe the error indicating that the JwtContext class cannot be found due to the import being registered as Jwt.
Expected behavior
The composer run codegen command should be able to generate the REST file without errors due to the incorrect import of the JwtContext class.
Proposed solution
Correct the import of the JwtContext class on templates/codegen/rest.php.jinja
When trying to generate a REST file using the command APP_ENV=dev composer run codegen -- --table example_crud rest --save or APP_ENV=dev composer run codegen -- --table example_crud all --save, the application is throwing an error indicating that the JwtContext class cannot be found. The reason for this error is that the import registered in the file is named Jwt instead of JwtContext.
Steps to reproduce Create an aplication
composer -sdev create-project byjg/rest-reference-architecture ~/tutorial master
Generate the fileAPP_ENV=dev composer run codegen -- --table example_crud rest --save
orAPP_ENV=dev composer run codegen -- --table example_crud all --save
Observe the error indicating that the JwtContext class cannot be found due to the import being registered as Jwt.
Expected behavior The composer run codegen command should be able to generate the REST file without errors due to the incorrect import of the JwtContext class.
Proposed solution Correct the import of the JwtContext class on
templates/codegen/rest.php.jinja
From:
use MyRest\Util\Jwt;
To:use MyRest\Util\JwtContext;