Ran into this while trying to locally start testing JSON API 2.0.0-beta1. The composer.json in jsonapoi_extras defines the requirement of "drupal/jsonapi": "^1.22",. This implies >=1.22 <2.0.0, so the requirement prevents installation of JSON API 2.0.0, and vice versa.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | jsonapi_extras-jsonapi_dependency-2994885-14.patch | 310 bytes | logickal |
| #12 | 2994885-12-jsonapi_extras-version-constraint.patch | 384 bytes | wim leers |
| #12 | interdiff.txt | 398 bytes | wim leers |
| #10 | 2994885-10-jsonapi_extras-version-constraint.patch | 316 bytes | eojthebrave |
| #2 | jsonapi_extras-jsonapi_dependency-2994885-2.patch | 307 bytes | logickal |
Comments
Comment #2
logickal commentedNot knowing what @eoipso plans in terms of version support, here's a quick patch that will allow JSON API and JSON API Extras to co-exist with Composer.
Comment #3
grimreaperHello,
As the JSONAPI 8.x-2.0.0-beta1 is recommended, I also ran into the same problem.
Thanks for the patch.
But even with the patch it prevents installation as the composer.json would be modified by the patch after requirements are checked.
Comment #4
logickal commentedYep, I should have chimed back in here. To get this to work for evaluation and development in one of my local stacks, I had to point the project at a local fork with the patch applied to a new branch.
It’s also worth noting that after instal it becomes obvious that Extras doesn’t play nice with 2.0.0 yet, but I have not had any time to start investigating.
Comment #5
littletiger commentedWhat would need to be done to make it compatible? Composer + working nicely with jsonapi 2.x ?
Comment #6
wim leersjsonapi_extrasis not yet compatible withjsonapi2.x. Sorry about that. Expect significant progress soon.Comment #7
eojthebraveIt looks like the compatibility with JSON API 2.x was fixed in #3004582: Make JSON API Extras 2.x (next release: 2.10) compatible with JSON API 2.0-beta2. However, the composer.json in the 8.x-2.10 release still includes
"drupal/jsonapi": "^1.22". So thus far I'm unable to use composer to install both JSON API 8.x-2.x and JSON API Extras 8.x-2.x together.Is patching the composer.json file the appropriate change to make now? If so, I'm happy to provide a patch.
Comment #8
ndobromirov commentedIt's impossible to test the compatibility fixes without this.
As the issue for the compatibility is major I am upgrading this to major as well.
Comment #9
wim leersI think so. Although please note that JSON API 2.0-beta2 is a few weeks old, and therefore does not yet include #3006270: Add ResourceTypeRepository::createResourceType() for easier JSON API Extras support and simpler code, which is required for JSON API Extras 2.10 to work with JSON API 2.x. We need to tag a new JSON API 2.x release. This is blocked on @e0ipso approving the tagging of a new release.
So for now you would have to manually install JSON API 2.x HEAD (at least commit
54f560dea96c1cdd32165e23639cb19bc588134f, newer is fine too).Comment #10
eojthebraveOkay. Seems like there's a bit of a race condition here where both modules need to get a new release in order to be compatible with one another. JSON API needs a new release to include the commit mentioned above. And JSON API Extras needs a new release to update the composer.json file. Either way, fixing the composer.json file in this module now even without JSON API having a new release is at least no worse than the current situation.
Would it be appropriate to do something like
"drupal/jsonapi": "^1.22 || ^2.0-beta3",since JSON API Extras is still compatible with the 8.x-1.x branch of JSON API? I realize there isn't yet a beta3 version of JSON API.Here's a patch with the proposed change. Let me know if the constraint should be something different. I'm relatively new to using them.
Comment #11
ndobromirov commentedI would RTBC that if the tag was there.
Comment #12
wim leershttps://www.drupal.org/project/jsonapi/releases/8.x-2.0-rc1 was released.
Comment #13
logickal commented@wim-leers beat me to it - but I think that the `rc-1` designation isn't strictly needed, as specifying version 2.0 installs the rc and will install the release when it lands. At risk of cluttering the issue with patches, uploading my version as well.
Comment #14
logickal commentedOooops, ignore #13, I renamed the wrong local patch.
Comment #15
logickal commentedComment #17
e0ipsoI didn't really know who to credit for this. I gave credit to everyone here.
Comment #18
e0ipso