github.com/gogf/gf/v2@v2.7.4/net/goai/goai_xextensions.go (about)

     1  // Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
     2  //
     3  // This Source Code Form is subject to the terms of the MIT License.
     4  // If a copy of the MIT was not distributed with this file,
     5  // You can obtain one at https://github.com/gogf/gf.
     6  
     7  package goai
     8  
     9  import (
    10  	"github.com/gogf/gf/v2/text/gstr"
    11  )
    12  
    13  // XExtensions stores the `x-` custom extensions.
    14  type XExtensions map[string]string
    15  
    16  func (oai *OpenApiV3) tagMapToXExtensions(tagMap map[string]string, extensions XExtensions) {
    17  	for k, v := range tagMap {
    18  		if gstr.HasPrefix(k, "x-") || gstr.HasPrefix(k, "X-") {
    19  			extensions[k] = v
    20  		}
    21  	}
    22  }