diff --git a/pkg/geolocation/geolocation.go b/pkg/geolocation/geolocation.go index 3d1d9c04a..4a9375b95 100644 --- a/pkg/geolocation/geolocation.go +++ b/pkg/geolocation/geolocation.go @@ -7,8 +7,8 @@ import ( type ( Geometry struct { - Type string `json:"type"` - Coordinates [2]float64 `json:"coordinates"` + Type string `json:"type"` + Coordinates []float64 `json:"coordinates"` } Properties struct { @@ -21,7 +21,7 @@ type ( } ) -func Parse(ss []string) (m *Full, err error) { +func Parse(ss []string) (m Full, err error) { if len(ss) == 0 { return } diff --git a/store/adapters/rdbms/aux_types.gen.go b/store/adapters/rdbms/aux_types.gen.go index d8fa3661d..c8e86a7ac 100644 --- a/store/adapters/rdbms/aux_types.gen.go +++ b/store/adapters/rdbms/aux_types.gen.go @@ -353,7 +353,7 @@ type ( Name string `db:"name"` Handle string `db:"handle"` Type string `db:"type"` - Location *geolocation.Full `db:"location"` + Location geolocation.Full `db:"location"` Ownership string `db:"ownership"` SensitivityLevel uint64 `db:"sensitivity_level"` Config systemType.ConnectionConfig `db:"config"` diff --git a/system/dal_connection.cue b/system/dal_connection.cue index 6cdfbd09a..720e2975e 100644 --- a/system/dal_connection.cue +++ b/system/dal_connection.cue @@ -13,7 +13,7 @@ dal_connection: schema.#Resource & { // omitting isPrimary and replacing with a special type type: { goType: "string" } - location: { goType: "*geolocation.Full" } + location: { goType: "geolocation.Full" } ownership: {} sensitivity_level: { goType: "uint64" } diff --git a/system/rest.yaml b/system/rest.yaml index 79a3ce1fb..48b702d6a 100644 --- a/system/rest.yaml +++ b/system/rest.yaml @@ -868,7 +868,7 @@ endpoints: title: type - name: location - type: "*geolocation.Full" + type: "geolocation.Full" required: true title: location parser: geolocation.Parse @@ -916,7 +916,7 @@ endpoints: title: type - name: location - type: "*geolocation.Full" + type: "geolocation.Full" required: true title: location parser: geolocation.Parse diff --git a/system/rest/dal_connection.go b/system/rest/dal_connection.go index b63d22566..2e47be4ed 100644 --- a/system/rest/dal_connection.go +++ b/system/rest/dal_connection.go @@ -161,7 +161,6 @@ func (ctrl DalConnection) federatedNodeToConnection(f *federationTypes.Node) *ty Name: f.Name, Handle: h, Type: federationTypes.NodeResourceType, - Location: nil, Ownership: f.Contact, Config: types.ConnectionConfig{ diff --git a/system/rest/request/dalConnection.go b/system/rest/request/dalConnection.go index 8d2741cfd..c6db5e4e4 100644 --- a/system/rest/request/dalConnection.go +++ b/system/rest/request/dalConnection.go @@ -76,7 +76,7 @@ type ( // Location POST parameter // // location - Location *geolocation.Full + Location geolocation.Full // Ownership POST parameter // @@ -123,7 +123,7 @@ type ( // Location POST parameter // // location - Location *geolocation.Full + Location geolocation.Full // Ownership POST parameter // @@ -279,7 +279,7 @@ func (r DalConnectionCreate) GetType() string { } // Auditable returns all auditable/loggable parameters -func (r DalConnectionCreate) GetLocation() *geolocation.Full { +func (r DalConnectionCreate) GetLocation() geolocation.Full { return r.Location } @@ -520,7 +520,7 @@ func (r DalConnectionUpdate) GetType() string { } // Auditable returns all auditable/loggable parameters -func (r DalConnectionUpdate) GetLocation() *geolocation.Full { +func (r DalConnectionUpdate) GetLocation() geolocation.Full { return r.Location } diff --git a/system/types/dal_connection.go b/system/types/dal_connection.go index d6140cb3a..aeffdfd9e 100644 --- a/system/types/dal_connection.go +++ b/system/types/dal_connection.go @@ -20,9 +20,9 @@ type ( Type string `json:"type"` - Location *geolocation.Full `json:"location,omitempty"` - Ownership string `json:"ownership"` - SensitivityLevel uint64 `json:"sensitivityLevel,string"` + Location geolocation.Full `json:"location"` + Ownership string `json:"ownership"` + SensitivityLevel uint64 `json:"sensitivityLevel,string"` Config ConnectionConfig `json:"config"` Capabilities ConnectionCapabilities `json:"capabilities"`