Closed (fixed)
Project:
JSON:API Extras
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
4 Jul 2017 at 07:24 UTC
Updated:
7 Aug 2017 at 13:55 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
logickal commentedHere's an initial patch to provide this validation, which I agree is probably a very good idea. It also compares the override to the original fields, so you couldn't set 'body' to 'nid' for example.
Comment #3
logickal commentedComment #4
e0ipsoThanks for the patch @logickal! This is looking good.
We should also investigate how to add an entity validation to make sure that we cannot even create those duplicates when saving the config entity without a form.
Would you like to work on that as part of this issue, or maybe just open a follow up issue and work (you or anyone else) on that there?
Comment #5
e0ipsoMarking as needs work since we should either:
Comment #6
logickal commentedI meant to come back to this over the weekend, but got distracted - I'll try to take a look at the entity validation over the next day or so!
Comment #7
logickal commented@e0ipso - I did some investigation and found that config entities don't support proper Drupal entity validation out of the box, so it will likely be a more basic Symfony validation solution. I've got about half of a patch, but I think it probably makes sense to go ahead and break that out into a separate ticket, which I will create.
Comment #8
mkolar commentedHello, #2 works with fields which is great, but you can still set resource type and url wrongly. You can have more resources with same url and rename types same.
Comment #9
mkolar commentedpatch.. Validates path and resource type
Comment #10
e0ipso@logickal I agree with your conclusion to add a follow up task for that. Did you get the chance to create that ticket? Can you link it to this issue?
Also, I think that the ability to validate configuration entities has been added recently. Did you check that?
Comment #12
e0ipsoThanks all! This was committed.
Comment #13
logickal commented@e0ipso - Yes, I opened https://www.drupal.org/node/2894897 to cover the entity validation, and Daniel let me know over there that it's now possible. I haven't had a chance yet to dive in, though - as soon as I can come up for air I will take another look at it!