[Meta, Plan] Version 2.0

Created on 24 June 2024, about 1 year ago

✨ Introduce "schematic" normalizers Active introduces core generation of content entity schema in JSON Schema format. This means the bulk of the heavy lifting in this module is unnecessary. However, we must still map the JSON Schema to entities exposed over JSON:API and provide routes, hypermedia links, etc.

This is a meta issue for migrating the module to do just this, while shedding much of the now-unnecessary schema generation logic.

In addition, I'd like to consider making this module a library for creating top-level JSON:API document schemas, and share that logic with openapi_jsonapi module. That would mean we have a single place to maintain that shared code. The schema-specific routes could be enabled through a submodule.

🌱 Plan
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States bradjones1 Digital Nomad Life

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @bradjones1
  • πŸ‡ΊπŸ‡ΈUnited States m.stenta

    This is a meta issue for migrating the module to do just this, while shedding much of the now-unnecessary schema generation logic.

    @bradjones1 Can we rename this issue so that it is more specifically about this refactor, instead of generally about "Version 2.0"?

    I think we will need to put out a 2.0.0 release to support Drupal 11 first, before tackling larger refactors.

    See: πŸ“Œ Automated Drupal 11 compatibility fixes for jsonapi_schema Needs review

  • πŸ‡ΊπŸ‡ΈUnited States m.stenta

    Nevermind! πŸ“Œ Automated Drupal 11 compatibility fixes for jsonapi_schema Needs review will not require a breaking change after all. Disregard my last comment. :-)

  • πŸ‡ΊπŸ‡ΈUnited States m.stenta

    Once we have support for Drupal 11 (see: πŸ“Œ Automated Drupal 11 compatibility fixes for jsonapi_schema Needs review ), we'll be able to run PHPStan tests via GitLab CI. I've already started working on fixing the existing issues. There aren't many, but some of them should be considered breaking changes. Specifically, replacing \Drupal:: calls with dependency injection requires changing the constructor arguments of DataDefinitionNormalizer, which would break any downstream classes that extend it. I would like to suggest we do that in 2.x and document it in the release notes as a breaking change. I may add an exception for that particular PHPStan rule so we can make everything else pass in the meantime.

  • πŸ‡ΊπŸ‡ΈUnited States m.stenta
  • πŸ‡ΊπŸ‡ΈUnited States m.stenta

    Specifically, replacing \Drupal:: calls with dependency injection requires changing the constructor arguments of DataDefinitionNormalizer, which would break any downstream classes that extend it. I would like to suggest we do that in 2.x and document it in the release notes as a breaking change. I may add an exception for that particular PHPStan rule so we can make everything else pass in the meantime.

    Update: I've added a phpstan-baseline.neon file in πŸ“Œ Fix PHPStan errors Active that ignores the \Drupal calls in 8.x-1.x, so all PHPStan tests pass moving forward and we can avoid introducing any new errors. I opened a follow-up issue that removes phpstan-baseline.neon and replaces the \Drupal calls with dependency injection, which can be reviewed and considered for merging into 2.x as a breaking change: πŸ“Œ \Drupal calls should be avoided in classes, use dependency injection instead Active .

Production build 0.71.5 2024