MCPcopy
hub / github.com/openai/openai-go / objKeyEncoder

Method objKeyEncoder

internal/apiform/encoder.go:427–437  ·  view source on GitHub ↗
(parent string)

Source from the content-addressed store, hash-verified

425}
426
427func (e encoder) objKeyEncoder(parent string) func(string) string {
428 if parent == "" {
429 return func(child string) string { return child }
430 }
431 switch e.arrayFmt {
432 case "brackets":
433 return func(child string) string { return parent + "[" + child + "]" }
434 default:
435 return func(child string) string { return parent + "." + child }
436 }
437}
438
439// Given a []byte of json (may either be an empty object or an object that already contains entries)
440// encode all of the entries in the map to the json byte array.

Callers 2

newStructTypeEncoderMethod · 0.95
encodeMapEntriesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected