Skip to content

Document the PATCH mapping generated by resources and single - #16271

Merged
codeconsole merged 1 commit into
apache:8.0.xfrom
codeconsole:docs/rest-resources-patch
Aug 30, 2026
Merged

Document the PATCH mapping generated by resources and single#16271
codeconsole merged 1 commit into
apache:8.0.xfrom
codeconsole:docs/rest-resources-patch

Conversation

@codeconsole

Copy link
Copy Markdown
Contributor

The guide documents seven mappings for resources and six for single. Both generate one more — PATCH has been generated since the action was added and was never documented, including in the "Explicit REST Mappings" equivalence list.

"/books"(resources: 'book')

is equivalent to eight mappings, not seven:

get    "/books"(controller: "book", action: "index")
get    "/books/create"(controller: "book", action: "create")
post   "/books"(controller: "book", action: "save")
get    "/books/$id"(controller: "book", action: "show")
get    "/books/$id/edit"(controller: "book", action: "edit")
put    "/books/$id"(controller: "book", action: "update")
patch  "/books/$id"(controller: "book", action: "patch")   // undocumented
delete "/books/$id"(controller: "book", action: "delete")

Adds the missing row to the resources, single and nested-resources tables in the URL mappings guide, and to the two action-convention tables in the REST section.

Also corrects the nested-resources table, which gave the edit URI as /books/${bookId}/authors/edit/${id}. The generated mapping appends /edit after the id, as asserted by RestfulResourceMappingSpec.

DEFAULT_RESOURCES_INCLUDES generates eight mappings (index, create,
save, show, edit, update, patch, delete) and DEFAULT_RESOURCE_INCLUDES
generates seven, but the guide listed only seven and six. PATCH has
been generated since the action was introduced and was never documented,
including in the "Explicit REST Mappings" equivalence list.

Also corrects the nested resources table, which gave the edit URI as
/books/${bookId}/authors/edit/${id}. The generated mapping appends
/edit after the id, as asserted by RestfulResourceMappingSpec.
@codeconsole
codeconsole merged commit 2e88f24 into apache:8.0.x Aug 30, 2026
68 of 74 checks passed
@codecov

codecov Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.7228%. Comparing base (2fd29c6) to head (811f25e).
⚠️ Report is 2 commits behind head on 8.0.x.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##                8.0.x     #16271        +/-   ##
==================================================
+ Coverage     54.7070%   54.7228%   +0.0158%     
- Complexity      20423      20430         +7     
==================================================
  Files            2101       2101                
  Lines          100978     100978                
  Branches        17907      17907                
==================================================
+ Hits            55242      55258        +16     
+ Misses          37873      37857        -16     
  Partials         7863       7863                

see 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@testlens-app

testlens-app Bot commented Aug 30, 2026

Copy link
Copy Markdown

🚨 TestLens detected 1 failed test 🚨

Here is what you can do:

  1. Inspect the test failures carefully.
  2. If you are convinced that some of the tests are flaky, you can mute them below.
  3. Finally, trigger a rerun by checking the rerun checkbox.

Test Summary

Groovy Snapshot Canary Build / Build Grails (shard 2) > :grails-test-examples-scaffolding:integrationTest

Test Runs Flakiness
UserControllerSpec > User list 3% 🟡

🏷️ Commit: 811f25e
▶️ Tests: 56677 executed
🟡 Checks: 57/76 completed

Test Failures

UserControllerSpec > User list (:grails-test-examples-scaffolding:integrationTest in Groovy Snapshot Canary Build / Build Grails (shard 2))
geb.waiting.WaitTimeoutException: condition did not pass in 30 seconds (failed with exception)
	at geb.waiting.Wait.waitFor(Wait.groovy:128)
	at geb.waiting.DefaultWaitingSupport.doWaitFor(DefaultWaitingSupport.groovy:55)
	at geb.waiting.DefaultWaitingSupport.waitFor(DefaultWaitingSupport.groovy:41)
	at geb.Page.waitFor(Page.groovy:120)
	at com.example.pages.LoginPage.login(LoginPage.groovy:39)
	at com.example.UserControllerSpec.User list(UserControllerSpec.groovy:48)
Caused by: Assertion failed: 

title != pageTitle && $('input', name: 'username').empty
|     |  |         |
|     |  |         false
|     |  'Please sign in'
|     false
'Please sign in'

	at com.example.pages.LoginPage.login_closure1(LoginPage.groovy:39)
	at com.example.pages.LoginPage.login_closure1(LoginPage.groovy)
	at geb.waiting.Wait.waitFor(Wait.groovy:117)
	... 5 more

Rerun Controls

Note

Checks are currently running using the configuration below.

Select tests to mute in this pull request:

🔲 UserControllerSpec > User list

Reuse successful test results:

🔲 ♻️ Only rerun the tests that failed or were muted before

Click the checkbox to trigger a rerun:

🔲 Rerun jobs


Learn more about TestLens at testlens.app/docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant