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

Function getDescription

cli/compose/schema/schema.go:110–123  ·  view source on GitHub ↗
(err validationError)

Source from the content-addressed store, hash-verified

108)
109
110func getDescription(err validationError) string {
111 switch err.parent.Type() {
112 case "invalid_type":
113 if expectedType, ok := err.parent.Details()["expected"].(string); ok {
114 return "must be a " + humanReadableType(expectedType)
115 }
116 case jsonschemaOneOf, jsonschemaAnyOf:
117 if err.child == nil {
118 return err.parent.Description()
119 }
120 return err.child.Description()
121 }
122 return err.parent.Description()
123}
124
125func humanReadableType(definition string) string {
126 if definition[0:1] == "[" {

Callers 1

ErrorMethod · 0.85

Calls 3

humanReadableTypeFunction · 0.85
TypeMethod · 0.45
DescriptionMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…