Problem/Motivation

When JSONAPI routes for resources are defined with an invalid resource type (either by not specifing the route "resource_type" or by specifying an invalid resource type that cannot be upcasted), the Open API doc crashes.

I'm not sure whether this is caused by broken code, and I'm not sure submitting a patch here is the right thing to do, but I'm attaching a patch that ensures a valid resource type is returned.

CommentFileSizeAuthor
#2 3173177-2.patch1.75 KBjsacksick

Comments

jsacksick created an issue. See original summary.

jsacksick’s picture

Status: Active » Needs work
StatusFileSize
new1.75 KB
andre.bonon’s picture

Status: Needs work » Reviewed & tested by the community

The same crash happened to me after Jsonapi Search API module was installed.
The module above doesn't set a route parameter "resource_type", so it is impossible to load the resourceType instance.

This patch works to me.

e0ipso’s picture

This looks good! thanks for the patch and the patience.

  • e0ipso committed 1b197e6 on 3.x authored by jsacksick
    Issue #3173177 by jsacksick, andre.bonon, e0ipso: Routes defining...
e0ipso’s picture

Version: 8.x-2.x-dev » 3.x-dev
Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.