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

[FEATURE] - Handle adaptation of returned values from run() when controller has a response schema #174

Open
cedricfrancoys opened this issue Aug 22, 2024 · 0 comments
Labels
feature New feature or request

Comments

@cedricfrancoys
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Values returned by eQual::run() are just parsed using json_decode and randomly match ORM types.

Describe the solution you'd like
Values returned by eQual::run() should be adapted to corresponding types from Response Schema, if defined by target controller.

Describe alternatives you've considered
Parse schema are use the adapter service to adapt data according to their type.

public static function run($type, $controller, $body=[], $root=false) {
    $result = config\eQual::run($type, $controller, $body, $root);
    // #todo - adapt values if controller has a response schema
    $data = json_decode($result, true);
    // if result is not JSON, return raw data
    if(is_null($data)) {
        return $result;
    }
[...]
@cedricfrancoys cedricfrancoys added the feature New feature or request label Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
Status: No status
Development

No branches or pull requests

1 participant