MCPcopy Create free account
hub / github.com/docker/cli / humanReadableType

Function humanReadableType

cli/compose/schema/schema.go:125–144  ·  view source on GitHub ↗
(definition string)

Source from the content-addressed store, hash-verified

123}
124
125func humanReadableType(definition string) string {
126 if definition[0:1] == "[" {
127 allTypes := strings.Split(definition[1:len(definition)-1], ",")
128 for i, t := range allTypes {
129 allTypes[i] = humanReadableType(t)
130 }
131 return fmt.Sprintf(
132 "%s or %s",
133 strings.Join(allTypes[0:len(allTypes)-1], ", "),
134 allTypes[len(allTypes)-1],
135 )
136 }
137 if definition == "object" {
138 return "mapping"
139 }
140 if definition == "array" {
141 return "list"
142 }
143 return definition
144}
145
146type validationError struct {
147 parent gojsonschema.ResultError

Callers 1

getDescriptionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…