Problem/Motivation
As #2300677: JSON:API POST/PATCH support for fully validatable config entities seems not to have lot of support we need to exclude ConfigEntity as rest resources thus helping contrib aka Rest UI with #2303369: Until #2300677 is fixed, show in REST UI that config entity resources are read-only
Proposed resolution
Make EntityResource abstract and add ContentEntityResource
abstract class EntityResource extends ResourceBase {
...
class ContentEntityResource extends EntityResource {
Remaining tasks
What more must be done to make this work?
Should class EntityDerivative made abstract too?
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#4 | do_not_expose_config-2339815-4.patch | 9.23 KB | mglaman |
#1 | rest-2339815-1.patch | 10.48 KB | dawehner |
Comments
Comment #1
dawehnerJust a rough start so far.
Comment #2
clemens.tolboomIt seems we will expose Config Entities as per #2308745-40: Remove rest.settings.yml, use rest_resource config entitiesComment #3
clemens.tolboomI misread so fixing #2
Comment #4
mglamanRe-roll of #1 to get it to apply again.
Comment #6
Wim LeersOnly this part really makes sense to me: just only handle content entities. Then config entity types won't get REST routes created for them. Which is all that is necessary I think? Why all the other stuff?
Attempting to improve the title based on my understanding of this issue. I'm certain it's not entirely accurate. Please clarify.
Comment #7
clemens.tolboomMaybe we should decide on this issue or #2300677: JSON:API POST/PATCH support for fully validatable config entities first? Should or shouldn't we expose config entities?
Comment #8
Wim LeersMy understanding:
Comment #9
swentel CreditAttribution: swentel commentedI think we can just close this one and fix the other :) (because it makes to me have rest support for config entities)
Comment #10
clemens.tolboomI agree with @wim-leers for fixing this issue too to get rid of the errors. And this is about a 8.0.x bug
Comment #11
swentel CreditAttribution: swentel commentedHmm, k, that's fair. The other one will never land for 8.0.x indeed.
Comment #12
Wim LeersYep. But then we first need to understand how the current code can actually cause breakage. Or is this solely for the purpose of allowing the REST UI contrib module to have slightly cleaner code?
Comment #14
dawehnerCan't we add some kind of config validation to never allow this kind of setting?
Comment #15
Wim LeersConfiguration doesn't have the concept of validation at all? We only have validation for importing:
\Drupal\Core\Config\ConfigEvents::IMPORT_VALIDATE
.Comment #17
Wim Leers#2724823: EntityResource: read-only (GET) support for configuration entities already fixed .
It added this: