最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

url - Escape commas in List<String> queryParam in Spring Boot - Stack Overflow

programmeradmin5浏览0评论

I have a Spring Boot REST API, generated via OpenAPI that accepts a list of strings as a query parameter. However, when a tag contains a comma (,) (e.g., "Testing, String"), Spring automatically splits it into multiple values.

Example request: test/strings=Testing, String

Expected result: strings = ["Testing, String"] // strings.length = 1

Actual result: strings = ["Testing", "String"] // strings.length = 2

Even if passing "," as %2C Spring still splits the string. Is there a way of telling Spring which commas should split the string and which are part of the string itself.

发布评论

评论列表(0)

  1. 暂无评论