Remove old, broken Validation

This commit is contained in:
Samuel Lorch 2023-10-09 23:37:40 +02:00
parent e12a1fe16f
commit f67ec52fae
13 changed files with 39 additions and 64 deletions

View file

@ -6,10 +6,10 @@ import (
)
type Interface struct {
Alias string `json:"alias,omitempty" validate:"min=0,max=3"`
Type InterfaceType `json:"type" validate:"min=0,max=3"`
AddressingMode InterfaceAddressingMode `json:"addressing_mode" validate:"min=0,max=2"`
Address *netip.Prefix `json:"address,omitempty" validate:"excluded_unless=AddressingMode 1"`
Alias string `json:"alias,omitempty"`
Type InterfaceType `json:"type"`
AddressingMode InterfaceAddressingMode `json:"addressing_mode"`
Address *netip.Prefix `json:"address,omitempty"`
HardwareDevice *string `json:"hardware_device,omitempty"`
// TODO fix Validator for int pointers with min=0,max=4094
VlanID *uint `json:"vlan_id,omitempty"`

View file

@ -1,6 +1,6 @@
package network
type Network struct {
Interfaces map[string]Interface `json:"interfaces" validate:"required,dive"`
StaticRoutes []StaticRoute `json:"static_routes" validate:"required,dive"`
Interfaces map[string]Interface `json:"interfaces"`
StaticRoutes []StaticRoute `json:"static_routes"`
}