MCPcopy Create free account
hub / github.com/devspace-sh/devspace / Vars

Function Vars

docs/hack/config/schemas/main.go:182–218  ·  view source on GitHub ↗
(s *jsonschema.Schema)

Source from the content-addressed store, hash-verified

180}
181
182func Vars(s *jsonschema.Schema) {
183 if s.Type == "" {
184 return
185 }
186
187 if s.Type == "string" {
188 return
189 }
190
191 if s.Type == "object" {
192 return
193 }
194
195 if s.Type == "array" {
196 return
197 }
198
199 if len(s.AnyOf) > 0 {
200 s.AnyOf = append(s.AnyOf, &jsonschema.Schema{
201 Type: "string",
202 Pattern: varspkg.VarMatchRegex.String(),
203 })
204 } else {
205 if len(s.OneOf) == 0 {
206 // Preserve original type
207 s.OneOf = append(s.OneOf, &jsonschema.Schema{
208 Type: s.Type,
209 Items: s.Items,
210 PatternProperties: s.PatternProperties,
211 })
212 }
213 s.OneOf = append(s.OneOf, &jsonschema.Schema{
214 Type: "string",
215 Pattern: varspkg.VarMatchRegex.String(),
216 })
217 }
218}
219
220func CleanUp(s *jsonschema.Schema) {
221 if len(s.OneOf) > 0 || len(s.AnyOf) > 0 {

Callers

nothing calls this directly

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected