The following patches are recommended or required for the module, based on your uses.

Schemata, Open API

If you wish to use Open API to generate documentation for your API instance, you'll need to apply the patch from #3084914-13: Support non-entity bundle types. The Commerce module leverages bundles that are not provided by a config entity type. The Schemata module currently does not handle bundles defined in code.

Drupal core

These patches are not required for normal use. But if you plan to install Commerce and JSON:API in a distribution using the config installation option, they are required. JSON:API causes route rebuilding during configuration imports. That means bundles provided by config entities do not exist and JSON:API's route provider crashes.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mglaman created an issue. See original summary.

mglaman’s picture

mglaman’s picture

Issue summary: View changes
mglaman’s picture

Issue summary: View changes
mglaman’s picture

Issue summary: View changes

JSON:API Schema has a release with the fix.

dobe’s picture

Would be good to state that JSONAPI Extras is not compatible with this module.

z3cka’s picture

+1 for mentioning that this module does not work with JSON:API Extras in the Docs & README.md. I tried applying the recommended patches etc. but still had issues with Open API doc generation.

Is there an issue for making this module compatible with JSON:API Extras? I'd love to know what the root of the problem is and can help test any patches.

In digging deeper, I found this thread on Drupal slack regarding jsonapi_extras.

mogio_hh’s picture

So this means Drupal Commerce is not usable for headless projects like NextDrupal for example due to compatibility issues with JSON:API Extras? - Is there any headless Drupal project, that is not using "JSON:API Extras"?

mglaman’s picture

Is there any headless Drupal project, that is not using "JSON:API Extras"?

Yeah, just about every project I have been on!

z3cka’s picture

Is there any headless Drupal project, that is not using "JSON:API Extras"?

@mogio_hh it seems that Druxt does not use JSON:API Extras, FWIW. Personally, I've gone away from JSON:API Extras as well because I don't really like modules that just make a bunch or random tweaks. Yes, they are convenient, but don't add much value beyond that, IMO.

bradjones1’s picture

So I'm not sure this entirely boils down to "not compatible with extras" but, yeah, it's not compatible with extras. For SEO purposes I'll note here that I kept getting ::withRelatableResourceTypes() must be called before getting relatable resource types. on install and cache clear. I _think_ this is due to some sort of race condition with other decorators of the resource type repository, but after an hour of trying to track it down I basically gave up.

Discussed with @mglaman briefly in Slack and it sounds like some maintenance has been done on this package to bring it up to speed with other ecosystem modules and core but it's a heavier lift than I'm looking to do, now.

Anybody made their first commit to this issue’s fork.

anybody’s picture

The documented patches at https://git.drupalcode.org/project/commerce_api/-/blob/8.x-1.x/README.md... need to be updated, they don't apply any more, I'll prepare a MR.

anybody’s picture

#3084914: Support non-entity bundle types is now fixed!

I'll remove it from the MR. #3091633: Support for cross bundle resource types is the last one now to be fixed for commerce_api! 🎉

socialnicheguru’s picture

The recommended patch no longer applies to latest version:

 - Applying patches for drupal/jsonapi_schema
    https://www.drupal.org/files/issues/2019-10-31/3091633-3.patch ([commerce_api]: Support for cross bundle resource types #3091633: Support for cross bundle resource types - https://www.drupal.org/project/commerce_api/issues/3116465)
   Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2019-10-31/3091633-3.patch