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

DingoGenerator.php response transformers shows original eloquent as json #153

Closed
softwareok1 opened this issue Feb 16, 2017 · 1 comment
Closed
Labels

Comments

@softwareok1
Copy link

Hi please help
"dingo/api": "1.0.*@dev",
"mpociot/laravel-apidoc-generator": "^1.7",

If using eloquent Models at router dingo with Transformers we get json from Object.

 'headers:{},
 'original": {
     "origfield":"value",
     "origfield":"value",
     "origfield":"value"
},
"exceptions":{} 

instead of expected transformed result:

"data":[
"transform":"transformval1"
}

in DingoGenerator 1.7 we added after LINE 26 as workaround

if(is_object($response)){
            $r=$response->content();
        }else{
            $r=$response;
        }
        ```
Reason: with transforming 
`$this->getRouteResponse($route, $bindings, $headers);`  returns an object with attribute protected content
@shalvah shalvah added the bug label Sep 8, 2018
@shalvah
Copy link
Contributor

shalvah commented Sep 8, 2018

We should be fixing this in version 3.

@shalvah shalvah closed this as completed Oct 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants