CoreyD97 / Burp-Montoya-Utilities

A collection of utilities for building extensions using Burp's Montoya API
GNU Affero General Public License v3.0
46 stars 9 forks source link

Expose more of the Gson API in IGsonProvider and DefaultGsonProvider #8

Closed CrazyKidJack closed 9 months ago

CrazyKidJack commented 9 months ago

This would allow users more control over the Gson object. For example, Gson does not have a default adapter for the Path type. Path is an interface, so with only the exposed registerTypeAdapter() method, separate adapters would need to be registered for each different implementation of Path even though basically every Path implementation should have the same JSON serialized representation.

Exposing the registerTypeHierarchyAdapter() method allows users to handle this situation more gracefully by only having to register a single adapter for the parent type.

registerTypeAdapterFactory() can be used in similar situations.

CoreyD97 commented 9 months ago

Thanks for the PR!