JSONAPI implements overrides and alterations to schemata schema. Some of this is being moved into schemata in #2882269: Support for JSON API's ResourceType::getPublicName() and ResourceType::isFieldEnabled(). Once this is complete, we should remove this from jsonapi_extras, since it will be redundant.

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

richgerdes created an issue. See original summary.

richgerdes’s picture

The attached patch removes the re implemented service to implement the ResourceType::getPublicName() and ResourceType::isFieldEnabled() functions for fields.

richgerdes’s picture

e0ipso’s picture

I believe you will still need this to get the schema out of the potential Field Enhancer.

richgerdes’s picture

The logic in the patch from #2882269: Support for JSON API's ResourceType::getPublicName() and ResourceType::isFieldEnabled() was the same as that found here. Since you went the route in #3053272: Update JSON:API Schema generation this logic may not have been preserved. I think doing it the #2882269: Support for JSON API's ResourceType::getPublicName() and ResourceType::isFieldEnabled() method would have been cleaner since it let us take out this customization from jsonapi.

Anyways, since we've gone the route we have, I think it would make sense to verify if this customization is still required here, or if the logic could still be moved over to schemata in order to keep things organized and prevent the need for jsonapi_extras of needing to care about schema.

bbrala’s picture

I see a lot of closed issues. @e0ipso since you know both modules, would you know if the status of this?

bradjones1’s picture

#4: I believe you will still need this to get the schema out of the potential Field Enhancer.

Yes. I came here looking to find/file an issue relating to the fact enhancer-altered schemas are not being merged in, when generating OpenAPI schema.

So, the bulk of the existing logic in this normalizer can go, since it's accounted for in the first-class field name/disablement support. However, we need to consult the field enhancer to get the correct schema.

Relates to #3224754: Make schema normalizer overrides module-agnostic (support jsonapi_schema as well as Schemata/OpenAPI)

bradjones1’s picture

Updated MR - the original included some code from #3229890: Better compatibility with other decorations of resource type repository - this is now clean. That other issue is NR, as well.

bradjones1’s picture

Status: Needs work » Needs review
bradjones1’s picture

@bbrala I think this and #3229890: Better compatibility with other decorations of resource type repository would be great to get in together to tag 3.21?

bbrala’s picture

Yeah, just wanted to wait for tests and then got sucked into something else :) I won't wait long for a release.

  • bbrala committed ad45ecb on 8.x-3.x authored by bradjones1
    Issue #3048718 by bradjones1, richgerdes, bbrala, e0ipso: Remove schema...
bbrala’s picture

Looking good, thanks!

bbrala’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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