Account created on 23 January 2020, over 5 years ago
#

Merge Requests

Recent comments

πŸ‡΅πŸ‡±Poland vasyapledov

For now - no.

πŸ‡΅πŸ‡±Poland vasyapledov

vasyapledov β†’ changed the visibility of the branch 3497467-take-gid-from to hidden.

πŸ‡΅πŸ‡±Poland vasyapledov

Added tests.
Fixed weight.

πŸ‡΅πŸ‡±Poland vasyapledov

@arunkumark

Please read the documentation of using RoutingEvents::ALTER and RoutingEvents::DYNAMIC from Drupal\Core\Routing\RouteBuilder.php

This code works AFTER route_callback.
Removing the execution results of the old route_callback is not a good idea, in my opinion.
It's much easier and better to use the new call instead of the old one - it's faster, easier and more reliable.

You didn't answer to my question, sorry.
I'll rephrase the question.

How to prevent execution of existing route_callback call?
How to execute another function only? I don't need existing totally - I need a new one.

πŸ‡΅πŸ‡±Poland vasyapledov

Strange.
The patch is applied successfully at my place locally on several Drupal variants.

Gathering patches for dependencies. This might take a minute.
  - Installing drupal/core (11.0.0-rc1): Extracting archive
  - Applying patches for drupal/core
    https://git.drupalcode.org/project/drupal/-/merge_requests/8863.diff (Add alter for `route_callbacks`)
πŸ‡΅πŸ‡±Poland vasyapledov

@arunkumark

If you can give me a better implementation - I will be very grateful.
I made this solution because I found no other options.

jsonapi.routing.yml

route_callbacks:
  - '\Drupal\jsonapi\Routing\Routes::routes'

Explain me, please, how to alter route_callback for jsonapi without call '\Drupal\jsonapi\Routing\Routes::routes'

According with \Drupal\Core\Routing\RouteBuilder::rebuild
Not from documentation (I know it) - check real code please.

$callback = $this->controllerResolver->getControllerFromDefinition($route_callback);
    if ($callback_routes = call_user_func($callback)) {
πŸ‡΅πŸ‡±Poland vasyapledov

vasyapledov β†’ changed the visibility of the branch 3460831-alter-route-callback to active.

πŸ‡΅πŸ‡±Poland vasyapledov

vasyapledov β†’ changed the visibility of the branch 3460831-alter-route-callback to hidden.

πŸ‡΅πŸ‡±Poland vasyapledov

vasyapledov β†’ changed the visibility of the branch 11.x to active.

πŸ‡΅πŸ‡±Poland vasyapledov

vasyapledov β†’ changed the visibility of the branch 11.x to hidden.

πŸ‡΅πŸ‡±Poland vasyapledov

vasyapledov β†’ changed the visibility of the branch 3460831-alter-route-callback to active.

πŸ‡΅πŸ‡±Poland vasyapledov

vasyapledov β†’ changed the visibility of the branch 3460831-alter-route-callback to hidden.

πŸ‡΅πŸ‡±Poland vasyapledov

This is the very draft variant of MultiAPI.

MulitAPI Functionality

  • Unilimited numbers of JSON:API variants
  • Independent JSON:API variants
  • JSON:API variants can be enabled/disabled independently of each other
  • JSON:API variants have independent path prefixes

Description

README MultiAPI.md

Installation


ATTENTION!

Before installation need to install core patch
https://www.drupal.org/project/drupal/issues/3460831
πŸ‡΅πŸ‡±Poland vasyapledov

vasyapledov β†’ changed the visibility of the branch 3218679-ability-to-expose to active.

πŸ‡΅πŸ‡±Poland vasyapledov

vasyapledov β†’ changed the visibility of the branch 3218679-ability-to-expose to hidden.

πŸ‡΅πŸ‡±Poland vasyapledov

vasyapledov β†’ made their first commit to this issue’s fork.

πŸ‡΅πŸ‡±Poland vasyapledov

I made the same code for taxonomy term and media.
It works on my side - but need additional checks.

πŸ‡΅πŸ‡±Poland vasyapledov

Fixed in new release.

πŸ‡΅πŸ‡±Poland vasyapledov

Fixed in a new release.

Production build 0.71.5 2024