hideEmptyRules not working in JSON LegendGraphic

Description

hideEmptyRules is working fine if I request a Legend as an image, but it is not working when using application/json as the output format.

For example, this request will return only 1 entry:
http://localhost:8080/geoserver/ne/wms?REQUEST=GetLegendGraphic&FORMAT=image/png&LAYER=world&BBOX=1.44,48.37,3.55,49.43&LEGEND_OPTIONS=hideEmptyRules:true

But if I asks for a json the hideEmptyRules option is ignored and it will return all entries:
http://localhost:8080/geoserver/ne/wms?REQUEST=GetLegendGraphic&FORMAT=application/json&LAYER=world&BBOX=1.44,48.37,3.55,49.43&LEGEND_OPTIONS=hideEmptyRules:true

Environment

None

Activity

Show:
Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Components

Priority

Created January 19, 2024 at 12:03 PM
Updated February 5, 2024 at 11:51 AM
Resolved February 5, 2024 at 11:51 AM