Network create/update requests were sending empty strings for unset fields
(firewall_zone_id, radiusprofile_id, usergroup_id, dhcpd_dns_*, wan_dns*,
and 20+ others) because their JSON struct tags lacked omitempty. The UniFi
controller interprets an explicit empty firewall_zone_id as a zone
disassociation, which triggers a global zone rebuild that causes all zone
policies to disappear from the UI.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add NetworkIDs and MatchOppositeNetworks fields to destination struct
- Add NETWORK to MatchingTarget validation for destination
- Update codegen schema to include destination network targeting
- Add AggregateNumPorts to DevicePortOverrides (compatibility fix)
This enables firewall zone policies to target specific destination
networks, matching the existing source.network_ids functionality.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>