Closed (duplicate)
Project:
Schemata
Version:
8.x-1.x-dev
Component:
JSON Schema
Priority:
Major
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
29 May 2017 at 21:08 UTC
Updated:
8 Jul 2019 at 15:08 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
e0ipsoI could not figure out a way to implement this without getting too complex or without creating a dependency on JSON API. I'm going to postpone this. Feel free to close it.
Comment #3
Grayside commentedSimilar to #2864667: The service "serializer.normalizer.data_reference_definition.schema_json.hal_json" has a dependency on a non-existent service "rest.link_manager", we could have a normalizer that introduces support based on the given module being enabled. Kind of a progressive-enhancement of schema behavior. Good demonstrations of how the schema can be customized have value.
Comment #4
wim leersYou still need JSON API Extras for a UI to do this. But the infrastructure for this actually lives in JSON API itself, and has since April 2017, since #2873820: Allow customizations.
And now JSON API is looking to use this too, to make its normalizations truly comply with the JSON API spec: #2977669: Spec Compliance: some entity types have an "id", "type" or "uuid" field, this violates the spec. So that changes this from
to
.
Comment #5
wim leers#2967572: Small inaccuracies for JSON API schemas fixed similar inaccuracies earlier today.
Comment #6
wim leersThis makes it work!
Comment #7
wim leersComment #8
e0ipsoThanks for this patch! Much needed.
Now that Schemata picking up pace again I hope we can get rid of the similar code that does this in JSON API Extras.
What about
NestedArray::unsetValue.Is this meant to read
continue?Probably a leftover that can be removed.
Let's keep a consistent style and do something similar to:
Like in 77 and 82.
Alternatively we could unconditionally rename so we reduce the cyclomatic complexity by one.
Comment #9
wim leersYes, this was super rough, but I figured a rough initial patch that at least works is better than the previous situation (not working and no patch).
Agreed with all points in #8 :)
(I don't think I'll have time to work on this before going on vacation next week, so I won't touch it for now — hopefully somebody else takes it further, and if not, then I'll have my work cut out for me when I get back to it, thanks to @e0ipso in #8 :))
Comment #10
e0ipso@Wim Leers is this something you are still interested in?
Comment #11
wim leersMy priorities currently lie with JSON API 2.x and issues closely related to that — I won't be working on this any time soon.
Comment #12
ShumaS commentedI`m update the patch as specified in comment #6, please check and add comments if there are any, thank you.
Comment #13
richgerdesThis patch looks good. Is there a good way to test that this correctly maps and filters fields? If so, it would be good to have tests for this.
Comment #14
richgerdesReviewing this patch again. Attached an interdiff of #6 and #12. #12 also introduces a few other changes, including moving the new logic to a dedicated method. Additionally it includes some code standards fixes. I think all the changes look good.
Comment #15
richgerdesI took a pass over this patch to clean it up and integrate some of the work being done in jsonapi_extras
Comment #16
richgerdes#3048718: Remove schema alterations for ResourceType::getPublicName() and ResourceType::isFieldEnabled() has been opened in order to remove the replaced code in jsonapi_extras.
Comment #17
e0ipsoThe patch in #15 is empty.
Comment #18
richgerdesI suck at git/patches sometimes, sorry for the delay re-uploading this.
Comment #19
e0ipsoNote that this is approached differently in #3053272: Update JSON:API Schema generation. Both patches try to solve the same issue, we should only merge one.
Comment #20
e0ipsoComment #21
richgerdes@e0ipso,
Now that #3053272: Update JSON:API Schema generation is merged. Can this issue be closed?
Comment #22
richgerdesI got confirmation that this issue is handled in #3053272: Update JSON:API Schema generation