internal/mcp: simplify content
Now that the protocol package is merged into the mcp package, clean up the higher level 'Content' union types, in favor of types constructors. Change-Id: I37bedb0ff0a296eef799ba65c37ca7f94ee1dbbe Reviewed-on: https://go-review.googlesource.com/c/tools/+/672415 Reviewed-by: Jonathan Amsterdam <jba@google.com> TryBot-Bypass: Jonathan Amsterdam <jba@google.com>
This commit is contained in:
parent
4f6510b9ae
commit
dac5be2c50
1 changed files with 107 additions and 207 deletions
|
|
@ -107,7 +107,7 @@ var declarations = config{
|
|||
Fields: config{"Params": {Name: "ReadResourceParams"}},
|
||||
},
|
||||
"ReadResourceResult": {
|
||||
Fields: config{"Contents": {Substitute: "*WireResource"}},
|
||||
Fields: config{"Contents": {Substitute: "*ResourceContents"}},
|
||||
},
|
||||
"Resource": {},
|
||||
"Role": {},
|
||||
|
|
@ -288,7 +288,7 @@ func writeType(w io.Writer, config *typeConfig, def *jsonschema.Schema, named ma
|
|||
if slices.ContainsFunc(def.AnyOf, func(s *jsonschema.Schema) bool {
|
||||
return s.Ref == "#/definitions/TextContent"
|
||||
}) {
|
||||
fmt.Fprintf(w, "WireContent")
|
||||
fmt.Fprintf(w, "Content")
|
||||
} else {
|
||||
// E.g. union types.
|
||||
fmt.Fprintf(w, "json.RawMessage")
|
||||
|
|
|
|||
Loading…
Reference in a new issue