labstack / echo

High performance, minimalist Go web framework
https://echo.labstack.com
MIT License
29.94k stars 2.23k forks source link

bind: Maintain backwards compatibility for map[string]interface{} binding #2656

Closed thesaltree closed 4 months ago

thesaltree commented 4 months ago

This PR modifies the bindData function to preserve the pre v4.12.0 behavior for map[string]interface{} while supporting the new functionality:

This approach maintains compatibility with existing code that expects single string values, while allowing new code to take advantage of multiple values when present.

The change addresses the issue reported in https://github.com/labstack/echo/issues/2652, where the binding behavior for map[string]interface{} changed in v4.12.0, potentially breaking existing implementations.

Testing:

Please review and let me know if any further changes are needed.