goai_xextensions.go 614 B

12345678910111213141516171819202122
  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. package goai
  7. import (
  8. "github.com/gogf/gf/v2/text/gstr"
  9. )
  10. // XExtensions stores the `x-` custom extensions.
  11. type XExtensions map[string]string
  12. func (oai *OpenApiV3) tagMapToXExtensions(tagMap map[string]string, extensions XExtensions) {
  13. for k, v := range tagMap {
  14. if gstr.HasPrefix(k, "x-") || gstr.HasPrefix(k, "X-") {
  15. extensions[k] = v
  16. }
  17. }
  18. }