jdaugherty commented on code in PR #16411:
URL: https://github.com/apache/grails-core/pull/16411#discussion_r4124944786


##########
grails-databinding/src/main/groovy/org/grails/databinding/converters/Jsr310ConvertersConfiguration.groovy:
##########
@@ -349,6 +351,35 @@ class Jsr310ConvertersConfiguration {
         }
     }
 
+    /**
+     * Binds a {@link Month} from its number, 1 for January through 12 for 
December, which is how
+     * {@code grails.converters.JSON}, JSON views and Spring Boot render a 
Month. Without it a number would bind
+     * through Spring's conversion service by ordinal, one month late. A month 
name still binds as any enum does.

Review Comment:
   Since f8ef37883d this no longer holds: `grails.converters.JSON` and JSON 
views render a `Month` as `"SEPTEMBER"`, and only Spring Boot writes the 
number. Something like:
   
   ```suggestion
        * Binds a {@link Month} from its number, 1 for January through 12 for 
December, which is how Spring Boot
        * renders a Month. Without it a number would bind through Spring's 
conversion service by ordinal, one month
        * late. The name that {@code grails.converters.JSON} and JSON views 
render binds as any enum does.
   ```
   
   Two tests make the same claim:
   
   - the class Javadoc of `MonthBindingSpec` (line 30)
   - the feature name `monthValueConverter binds a month number, as 
grails.converters.JSON and JSON views render a Month` in 
`Jsr310ConvertersConfigurationSpec` (line 299)



-- 
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