You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey @bingSea, I'm here to help you with any bugs, questions, or contributions. Let me know how I can assist you!
Apollo's web interface renders JSON content using a directive called showTextModalDirective. This directive processes JSON content and may remove duplicate keys during rendering. The JSON parsing is handled by the parseBigInt function, which processes the text to handle large integers by replacing them with a specific format before parsing [1].
To address the issue of duplicate keys being removed in the display, you can consider modifying the showTextModalDirective or the parseBigInt function. These components are responsible for parsing and rendering JSON content, and by altering their logic, you can change how JSON is processed and displayed. This could involve customizing the JSON parsing logic to preserve duplicate keys or providing an option for users to choose how JSON content is displayed, such as in raw text format.
Currently, there is no built-in configuration option in Apollo to change how JSON content is displayed or formatted, so any changes would need to be implemented in the codebase [1].
When the names within an object are not
unique, the behavior of software that receives such an object is
unpredictable. Many implementations report the last name/value pair
only. Other implementations report an error or fail to parse the
object, and some implementations report all of the name/value pairs,
including duplicates.
描述bug
本人在使用
Apollo
(1.8.x
)作为配置中心时,发现如果配置内容为json
格式时,Apollo
会自动进行格式化展示,本来是一个很方便的功能,但最近却遇到了一件糟心的事情,因为Apollo
展示时,会自动去掉重复的key
,但程序实际获取的内容还是带有重复的key
,程序一直报错,到Apollo
里检查又看不出错误,这对于配置json
内容较大时,更不容易查出。复现
直接添加带有重复
key
的json
格式内容,点击内容,即可复现,如图:期望
后续修复一下,对于内容展示形式,可以让用户自行选择,比如
json
,text
等,当不能展示对应格式时,给出相应提示,而不是自行对内容进行格式化,然后悄悄去掉重复的key
,让用户排查错误到怀疑人生。The text was updated successfully, but these errors were encountered: