1 package restful 2 3 // Copyright 2021 Ernest Micklei. All rights reserved. 4 // Use of this source code is governed by a license 5 // that can be found in the LICENSE file. 6 7 // ExtensionProperties provides storage of vendor extensions for entities 8 type ExtensionProperties struct { 9 // Extensions vendor extensions used to describe extra functionality 10 // (https://swagger.io/docs/specification/2-0/swagger-extensions/) 11 Extensions map[string]interface{} 12 } 13 14 // AddExtension adds or updates a key=value pair to the extension map. 15 func (ep *ExtensionProperties) AddExtension(key string, value interface{}) { 16 if ep.Extensions == nil { 17 ep.Extensions = map[string]interface{}{key: value} 18 } else { 19 ep.Extensions[key] = value 20 } 21 } 22