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

Conditional Relationship throws UnexpectedValueException('Unexpected resource relationship value.') when encoding #25

Closed
Wizofgoz opened this issue Feb 11, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@Wizofgoz
Copy link

Example in Resource file's relationships method:

return [
    $this->when($this->showAddress, $this->relation('address')),
];

Thrown in file laravel-json-api/encoder-neomerx/src/Schema/Relationships.php Line 103 as of v1.0.0-alpha.3 because the ConditionalList iterator returns it as a ConditionalField instead of JsonApiRelation.

@lindyhopchris
Copy link
Contributor

Ah yes, good point! Will get that fixed now.

@lindyhopchris lindyhopchris added the bug Something isn't working label Feb 12, 2021
@lindyhopchris
Copy link
Contributor

@Wizofgoz this should be sorted now. To give it a go:

composer config minimum-stability dev
composer require laravel-json-api/laravel:^1.0.0-alpha.4 --no-update
composer up laravel-json-api/*

@Wizofgoz
Copy link
Author

Looks to be fixed to me! Thank you! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants