From c382e28ab27b03d0a6e135e407823467da534b59 Mon Sep 17 00:00:00 2001 From: Marcus Weiner Date: Fri, 12 Jul 2024 20:48:46 +0200 Subject: [PATCH] Allow implementing type switch on family of nested IP address --- netbox/models/nested_ip_address.go | 15 +-------------- swagger.json | 4 ++-- swagger.processed.json | 2 +- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/netbox/models/nested_ip_address.go b/netbox/models/nested_ip_address.go index 1543c89ff0..a990d0a092 100644 --- a/netbox/models/nested_ip_address.go +++ b/netbox/models/nested_ip_address.go @@ -46,7 +46,7 @@ type NestedIPAddress struct { // Family // Read Only: true - Family int64 `json:"family,omitempty"` + Family interface{} `json:"family,omitempty"` // ID // Read Only: true @@ -105,10 +105,6 @@ func (m *NestedIPAddress) ContextValidate(ctx context.Context, formats strfmt.Re res = append(res, err) } - if err := m.contextValidateFamily(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateID(ctx, formats); err != nil { res = append(res, err) } @@ -132,15 +128,6 @@ func (m *NestedIPAddress) contextValidateDisplay(ctx context.Context, formats st return nil } -func (m *NestedIPAddress) contextValidateFamily(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "family", "body", int64(m.Family)); err != nil { - return err - } - - return nil -} - func (m *NestedIPAddress) contextValidateID(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "id", "body", int64(m.ID)); err != nil { diff --git a/swagger.json b/swagger.json index 9f06aa6abb..12e0a8878a 100644 --- a/swagger.json +++ b/swagger.json @@ -71480,7 +71480,7 @@ }, "family": { "title": "Family", - "type": "integer", + "type": "object", "readOnly": true }, "address": { @@ -94676,4 +94676,4 @@ } } } -} +} \ No newline at end of file diff --git a/swagger.processed.json b/swagger.processed.json index da8793b1f0..a8585db9d9 100644 --- a/swagger.processed.json +++ b/swagger.processed.json @@ -70427,7 +70427,7 @@ }, "family": { "title": "Family", - "type": "integer", + "type": "object", "readOnly": true }, "address": {