google / go-dap

Go implementation of the Debug Adapter Protocol
Apache License 2.0
127 stars 22 forks source link

Use json.RawMessage when polymorphic fields contain submessages #88

Closed corneliusweig closed 8 months ago

corneliusweig commented 8 months ago

So far, these fields were represented as interface{}, which means that the JSON library parsed these fields. However, they contain opaque data, which makes it very inconvenient to work with such a message. Now, fields with a submessage are represented as json.RawMessage, so that applications can re-parse these submessages into the correct structure more easily.

If the list of types only contains fundamental types, we stick with interface{}.