Problem/Motivation

Replace JSON:API Schema dependency with Open API JSON:ARG module

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

grasmash created an issue. See original summary.

grasmash’s picture

Title: Replace JSON:API Schema dependency with Open API JSON:ARG module » Replace JSON:API Schema dependency with Open API JSON:API module

grasmash’s picture

Status: Active » Needs review

balsama made their first commit to this issue’s fork.

balsama changed the visibility of the branch backup to hidden.

balsama’s picture

The last commit fixes the PHPUnit tests. It does not fix the gitlab CI integration. That should be done in a separate issue.

ankitv18’s picture

Validated the MR!5
Query builder page throwing 404 error
404 error

jsonapi_query_builder_update_10001 isn't executed properly
hook

balsama’s picture

It looks like you didn't update the composer dependencies when testing the update path? The update hook installs openapi_jsonapi, which the MR requires in its composer.json file. But according to your error, you don't have it in your codebase.

As for the JS error, you need to manually rebuild the JS app if you're testing it locally. (cd js; ./build.sh)

I think this all working as designed, but it would still be good to get a manual test that confirms.

traviscarden made their first commit to this issue’s fork.

traviscarden’s picture

Status: Needs review » Needs work
traviscarden’s picture

I've made a lot of progress here--I fixed the update hook a ton of static analysis, and some of the test issues--but I'm still having trouble with the React aspect of the JavaScript functional tests. I've improved the assertions a little and added a commit with some debugging output showing the HTML that Mink is getting before it starts looking for CSS selectors (as in, I actually committed the debugging output file so you can see it). It seems like the React app isn't initializing. It works just fine in manual testing, though. The failures are the same locally as on CI. Can anyone offer any guidance?

traviscarden’s picture

I've identified and fixed several more secondary issues, including a 403 error due to a missing route. Here's where things stand as I take off for the weekend. (Monday is a federal holiday in the U.S., so I won't be back till Tuesday.)

I think all the functional JavaScript tests are failing for the same reason, so I'm focusing on fixing one of them first: \Drupal\Tests\jsonapi_query_builder\FunctionalJavascript\JsonApiQueryBuilderJsTest::testReactAppLoads(). The problem seems to be that the test browser (Mink/Selenium) doesn't render any React markup, while a real browser does. I've committed a few HTML dumps and screenshots for comparison:

All the functional JavaScript tests are failing with the same error:

1) Drupal\Tests\jsonapi_query_builder\FunctionalJavascript\JsonApiQueryBuilderJsTest::testReactAppLoads
Behat\Mink\Exception\ElementNotFoundException: Element matching css ".query-panel-tab[data-tab="fields"]" not found.

/var/www/html/vendor/behat/mink/src/WebAssert.php:465
/var/www/html/tests/src/FunctionalJavascript/JsonApiQueryBuilderJsTest.php:113

There are no more errors in the logs:

 ---- -------------- -------- ---------- ------------------------------------------------------------
  ID   Date           Type     Severity   Message
 ---- -------------- -------- ---------- ------------------------------------------------------------
  11   30/Aug 07:12   user     Info       User xlpztkl0 used one-time login link at time 1756501921.
  10   30/Aug 07:12   user     Info       Session opened for xlpztkl0.
  9    30/Aug 07:12   system   Info       jsonapi_query_builder module installed.
  8    30/Aug 07:12   system   Info       openapi_jsonapi module installed.
  7    30/Aug 07:12   system   Info       schemata_json_schema module installed.
  6    30/Aug 07:12   system   Info       schemata module installed.
  5    30/Aug 07:11   system   Info       openapi module installed.
  4    30/Aug 07:11   system   Info       jsonapi module installed.
  3    30/Aug 07:11   system   Info       serialization module installed.
  2    30/Aug 07:11   system   Info       field_ui module installed.
 ---- -------------- -------- ---------- ------------------------------------------------------------

That's what I know at the moment. If my Functional JavaScript Test fairy doesn't visit over the weekend, I'll pick this up again on Tuesday.

ankitv18’s picture

Hi @traviscarden,
I've validated the functionality of this module and found few issues on sorting tab.
When I add the moderation_state
Drupal\Core\Entity\Query\QueryException: 'moderation_state' not found in Drupal\Core\Entity\Query\Sql\Tables->ensureEntityTable() (line 373 of /var/www/html/docroot/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php).
Moderation state
When I add the UUID or Path field getting 400 error in response.
Drupal\Core\Http\Exception\CacheableBadRequestHttpException: Invalid nested filtering. The field `uuid`, given in the path `uuid`, does not exist. in Drupal\jsonapi\Context\FieldResolver->resolveInternalEntityQueryPath() (line 292 of /var/www/html/docroot/core/modules/jsonapi/src/Context/FieldResolver.php).
400 issue

traviscarden’s picture

Issue summary: View changes

Thank you, @ankitv18. Do you know when these issues were introduced? Are they already there on the main branch, or are they regressions from this issue? And if this issue has introduced them, did they work before my changes and now they're broken?

Are you following a test script on this issue, or are you doing unguided/exploratory testing? If there are tests you're repeating as the issue progresses, would you share your checklist?

traviscarden’s picture

I've redone the local work (I want to make sure I didn't mess one of them up before; I'm not certain.) Here's the update:

All the functional JavaScript tests are failing with the same error:

1) Drupal\Tests\jsonapi_query_builder\FunctionalJavascript\JsonApiQueryBuilderJsTest::testReactAppLoads
Behat\Mink\Exception\ElementNotFoundException: Element matching css ".query-panel-tab[data-tab="fields"]" not found.

/var/www/html/vendor/behat/mink/src/WebAssert.php:465
/var/www/html/tests/src/FunctionalJavascript/JsonApiQueryBuilderJsTest.php:121

There are no more errors in the logs:

 ---- -------------- -------- ---------- ------------------------------------------------------------
  ID   Date           Type     Severity   Message
 ---- -------------- -------- ---------- ------------------------------------------------------------
  11   04/Sep 04:12   user     Info       User kw696290 used one-time login link at time 1756923133.
  10   04/Sep 04:12   user     Info       Session opened for kw696290.
  9    04/Sep 04:12   system   Info       jsonapi_query_builder module installed.
  8    04/Sep 04:12   system   Info       openapi_jsonapi module installed.
  7    04/Sep 04:12   system   Info       schemata_json_schema module installed.
  6    04/Sep 04:12   system   Info       schemata module installed.
  5    04/Sep 04:12   system   Info       openapi module installed.
  4    04/Sep 04:12   system   Info       jsonapi module installed.
  3    04/Sep 04:12   system   Info       serialization module installed.
  2    04/Sep 04:12   system   Info       field_ui module installed.
 ---- -------------- -------- ---------- ------------------------------------------------------------
traviscarden’s picture

Issue summary: View changes
Status: Needs work » Needs review

I don't know why the tests are still failing on CI. They're all passing locally, and so is stylelint. I've been instructed to go ahead and disable the failing jobs so we can merge the MR. I have done so, and of course, the build passes now.

I have extracted @ankitv18's comment in #15 to its own issue: #3545512: Errors when sorting.

Handing off to @balsama for review and merge.

balsama’s picture

Status: Needs review » Reviewed & tested by the community

Thanks.

  • balsama committed e27bcc60 on 1.0.x
    Issue #3529219: Replace JSON:API Schema dependency with Open API JSON:...

  • balsama committed e27bcc60 on 2.0.x
    Issue #3529219: Replace JSON:API Schema dependency with Open API JSON:...
balsama’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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