LiveBeansView generates invalid JSON on specific case [SPR-11366] #15992
In org.springframework.context.support.LiveBeansView, the JSON snapshot of beans has a comma "," at the end of the last bean definition on a specific case when one of these met:
It looks like the logic to generate the JSON in "generateJson(Set<ConfigurableApplicationContext> contexts)" method adds comma "," to the bean definitions based on the beanNames length. But if any of the above conditions met this adds the comma to the last bean definition as well. This causes the JSON to be invalid.
Affects: 3.2 GA, 4.0 GA
Backported to: 3.2.8
The text was updated successfully, but these errors were encountered:
Juergen Hoeller commented
Good catch! I've taken the opportunity to refine LiveBeansView's implementation a bit, also extracting an overridable isBeanEligible template method.
Feel free to give this a try with the upcoming 4.0.2 snapshot...