JSON 쓰면서 주석 달수 있나요?

LONGNEW·2020년 12월 31일
0

StackOverFlaw

목록 보기
7/16

Q. Can I use comments inside a JSON file? If so, how?
Q. JSON 파일에 주석 달수 있나요??


No.
아뇨.
The JSON is data only, and if you include a comment, then it will be data too.
JSON 은 데이터만을 취급합니다. 주석을 달게 되면 그것까지 데이터로 취급됩니다.
You could have a designated data element called "_comment" (or something) that should be ignored by apps that use the JSON data.
그런데 데이터 중에 "_comment"로 불려진 데이터는 앱이 JSON 데이터를 이용할때 무시합니다.
You would probably be better having the comment in the processes that generates/receives the JSON, as they are supposed to know what the JSON data will be in advance, or at least the structure of it.
JSON을 생성하거나 받을 때 주석을 가지고 있어야 합니다. JSON 데이터에 대해 이미 알거나 최소한 그 구조를 알고 있기 때문이죠

0개의 댓글