Source File
utils.go
Belonging Package
github.com/invopop/jsonschema
package jsonschemaimport (orderedmap)var matchFirstCap = regexp.MustCompile("(.)([A-Z][a-z]+)")var matchAllCap = regexp.MustCompile("([a-z0-9])([A-Z])")// ToSnakeCase converts the provided string into snake case using dashes.// This is useful for Schema IDs and definitions to be coherent with// common JSON Schema examples.func ( string) string {:= matchFirstCap.ReplaceAllString(, "${1}-${2}")= matchAllCap.ReplaceAllString(, "${1}-${2}")return strings.ToLower()}// NewProperties is a helper method to instantiate a new properties ordered// map.func () *orderedmap.OrderedMap[string, *Schema] {return orderedmap.New[string, *Schema]()}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |