Skip to content

Error when generating REST file with composer run codegen command #11

@cdenadai

Description

@cdenadai

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

From:
use MyRest\Util\Jwt;
To:
use MyRest\Util\JwtContext;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions