codeconsole commented on PR #16414:
URL: https://github.com/apache/grails-core/pull/16414#issuecomment-6204669871

   @matrei thanks, all addressed in 2ec20172f5, including the startup warning.
   
   **1. REST guide dates.** The section is back to the 9.0.x text, which 
describes the default: `OffsetTime` keeps its seconds, `Month` renders by name, 
map keys are formatted as before, and the `Month` marshaller example is back. A 
closing paragraph covers `legacy: false`: `OffsetTime` from `toString()`, 
`Month` as a number, and map keys through the mapper's key serializers.
   
   **2. Upgrade guide.** The map key and `toString(false)` paragraphs now start 
with "With the setting `false`".
   
   **3. `PATH`.** The fix stays in both modes. The `PATH` paragraph now starts 
with "Whatever the setting" and gives your first example, and the legacy 
section lists it with the other exceptions to "the same text as in Grails 8". 
`Grails8JsonRenderingSpec` has a feature with your two examples. I ran them on 
8.0.x (1435057571) and got `root.x.n` and `root.a.x`, as you did.
   
   **4. End to end.** `hibernate5/grails-hibernate` now opts in through its 
`application.yml` (`legacy: false`, `spring.jackson.time-zone: 
America/New_York`). `JsonMapperConverterSpec` renders a `Shipment` whose 
`carrier` is a lazy association, through the mapper Spring Boot auto-configures:
   
   ```
   {"id":1,"shipped":"1969-12-31T19:00:00.000-05:00","carrier":{"id":1}}
   ```
   
   I checked that the carrier is still an uninitialized `HibernateProxy` after 
rendering, and that the spec fails with `legacy: true`. I put it in that app 
rather than app1 because `ConvertersConfigurationHolder` is static. A second 
app1 context with `legacy=false` would leave its configuration in place for the 
app1 specs that run after it in the same JVM. None of that app's other specs 
render JSON.
   
   **5. Version.** All 15 places now say "a later release" instead of Grails 10.
   
   **Startup warning.** Done as you suggested. While 
`grails.converters.json.legacy` is not set, the initializer logs one WARN per 
JVM, guarded by a static `AtomicBoolean`:
   
   ```
   grails.converters.json.legacy is not set, so the JSON converter renders JSON 
as Grails 8 did. A later release renders JSON through the application's 
JsonMapper by default. Set it to true to keep the Grails 8 rendering, or to 
false to render through the JsonMapper now; see "Rendering JSON As Grails 8 
Did" in the upgrade guide.
   ```
   
   `ConvertersConfigurationInitializerSpec` covers the three cases: unset warns 
once across two initializations, and `true` and `false` don't. The upgrade 
guide mentions the warning and says that either value turns it off.
   
   Tests run on this head:
   - `grails-converters`: 413 tests pass.
   - `grails-web-common`: 144 tests pass.
   - `codeStyle` and `publishGuide` succeed.
   - `hibernate5/grails-hibernate` integration tests: all pass except 
`BookControllerSpec`. That spec couldn't start locally because Docker ran out 
of disk pulling the Selenium image; CI runs it.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to