geoserver / geoserver-cloud

Cloud Native GeoServer is GeoServer ready to use in the cloud through dockerized microservices.
http://geoserver.org/geoserver-cloud
Other
245 stars 74 forks source link

pgconfig: encode null values in JSON for Postgres jsonb_populate_record() to update automatic columns #428

Closed groldan closed 7 months ago

groldan commented 7 months ago

Use a Jackson ObjectMapper configured for the PostgreSQL JSONB encoding of catalog and config info objects. In particular, null values must be encoded as null in JSON, for the Postgres triggers calling populate_table_columns_from_jsonb() to correctly unset columns used for joining when values in the JSON representation change to null.

For example, if a layer group is moved from one workspace to no-workspace, the layergroupinfo.workspace table column must be automatically set to null by populate_table_columns_from_jsonb(), which won't happen if the new JSON object does not have the "workspace": null property, as when the ObjectMapper has default property inclusionInclude#NON_EMPTY`.