Difference between revisions of "JSON/ko"

From Lazarus wiki
Jump to navigationJump to search
 
(3 intermediate revisions by one other user not shown)
Line 47: Line 47:
 
There are a few rules and guidelines that define the JSON syntax (see RFC 4627):
 
There are a few rules and guidelines that define the JSON syntax (see RFC 4627):
  
* JSON objects are encapsulated within opening and closing brackets <code>{ }</code>. An empty object can be represented by <code>{ }</code>
+
* JSON 오브젝트의 경우 반드시 {}로 열고 닫아야합니다. <code>{ }</code>. 빈 값의 오브젝트일 경우에도 {}로 열고 닫아야합니다. <code>{ }</code>
* 배열은 중괄로 열고 닫아야 하며 값의 분리는 ,쉼표여야 합니다. <code>[ ]</code>. An empty array can be represented by <code>[ ]</code>
+
* 배열은 대괄호로 열고 닫아야 하며 값의 분리는 ,쉼표여야 합니다. <code>[ ]</code>. 빈값의 배열일 경우 []로 열고 닫아야 합니다. <code>[ ]</code>
* A member is represented by a key-value pair
+
* 키와 값으로 쌍을 이루어야 합니다.
* The key of a member should be contained in double quotes
+
* 키의 경우 더블쿼로로 감싸야 합니다.
* Each member SHOULD have a unique key within an object structure
+
* 모든 맴버중 오브젝트는 유일한 키어야 합니다.
* The value of a member must be contained in double quotes if it is a string
+
* 값 중 문자열의 경우 반드시 더블 쿼터안에 있어야 합니다.
 
* 불값은 '''true''' 또는 '''false''' 로 표기되어야 합니다.
 
* 불값은 '''true''' 또는 '''false''' 로 표기되어야 합니다.
 
* Number values are represented using double-precision floating-point format; Scientific notation is supported; Numbers should not have leading zeroes
 
* Number values are represented using double-precision floating-point format; Scientific notation is supported; Numbers should not have leading zeroes
 
* "Offensive" characters in a string need to be escaped using the backslash character
 
* "Offensive" characters in a string need to be escaped using the backslash character
 
* 널값은 싱글쿼터 ''' Null ''' 또는 소문자 '''null'''로 표기 되어야 합니다.
 
* 널값은 싱글쿼터 ''' Null ''' 또는 소문자 '''null'''로 표기 되어야 합니다.
* Other object types, such as dates, are not natively supported and should be converted to strings; to be managed by the parser/client
+
* 다른 오브젝트 타입일 경우 예를들면 날자나, 그외 문자열일경우 문자열로 표기되어야 합니다.
 
* Each member of an object or each array value must be followed by a comma if it is not the last one  
 
* Each member of an object or each array value must be followed by a comma if it is not the last one  
* The common extension for json files is '''.json'''
+
* json 일반적 확장자는다음과 같습니다. '''.json'''
* The MIME type for json files is '''application/json'''
+
* json파일의 MIME 타입은 다음과 같습니다. '''application/json'''
  
 
== 구현 ==
 
== 구현 ==
Line 87: Line 87:
 
* [[Streaming JSON/ko]] - (korean translation from English )
 
* [[Streaming JSON/ko]] - (korean translation from English )
 
* [[Streaming JSON]]  - (English translation from original German)
 
* [[Streaming JSON]]  - (English translation from original German)
 
[[Category:JSON]]
 
{{LngBarItem|Caption={{#language:ko}}&nbsp;(ru)|Link={{{NameWithoutSuffix}}}/ru}}
 

Latest revision as of 22:48, 24 February 2017

English (en) suomi (fi) 日本語 (ja) 한국어 (ko) polski (pl) русский (ru) 中文(中国大陆)‎ (zh_CN)

소개

JSON (JavaScript Object Notation) is a form of data representation that provides a standardised data exchange format using simple text. As the name suggests, it is based on a subset of the JavaScript programming language; however, it is completely language-agnostic. Besides being easy for humans to read and write, it is also easy for machines to parse and generate.

Compared to XML, it is more human-readable.

JSON Object

A JSON Object is nothing more than a collection of comma-separated name/value pairs (often called members) enclosed in curly brackets:

{"name1":value1, "name2":value2 ...}

To make it easier for humans to read and visualize, the name/value pairs are often listed vertically:

{
	"name1": value1,
	"name2": value2
}

문자열의 이름은 더블쿼터 안에 있어야 지원합니다, 다음사항을 참고하세요:

  • 단순 문자열, 숫자, 불 또는 널 값 (문자열은 더블쿼터로 닫아야합니다.):
    {"id":1, "name":"John Doe", "married":false}
  • 배열; 값은 쉼표로 분리하고 대괄호로 열고 닫아야 합니다.:
    {"primeNumbers":[2, 3, 5, 7, 11, 13, 17], "oddNumbers":[1,3,5,7]}
  • 오브젝트; 한쌍으로 name:value 형태이며 중괄호로 열고 닫아야 합니다.:
    {"address":{"street":"145 Koinange Street", "City":"Nairobi", "Countㅇry":"Kenya"}}


JSON objects can always be nested arbitrarily to create even more complex objects:

{"user":
	{	"userid": 1900,
		"username": "jsmith",
		"password": "secret",
		"groups": [ "admins", "users", "maintainers"]
	}
}


JSON 포맷

There are a few rules and guidelines that define the JSON syntax (see RFC 4627):

  • JSON 오브젝트의 경우 반드시 {}로 열고 닫아야합니다. { }. 빈 값의 오브젝트일 경우에도 {}로 열고 닫아야합니다. { }
  • 배열은 대괄호로 열고 닫아야 하며 값의 분리는 ,쉼표여야 합니다. [ ]. 빈값의 배열일 경우 []로 열고 닫아야 합니다. [ ]
  • 키와 값으로 쌍을 이루어야 합니다.
  • 키의 경우 더블쿼로로 감싸야 합니다.
  • 모든 맴버중 오브젝트는 유일한 키어야 합니다.
  • 값 중 문자열의 경우 반드시 더블 쿼터안에 있어야 합니다.
  • 불값은 true 또는 false 로 표기되어야 합니다.
  • Number values are represented using double-precision floating-point format; Scientific notation is supported; Numbers should not have leading zeroes
  • "Offensive" characters in a string need to be escaped using the backslash character
  • 널값은 싱글쿼터 Null 또는 소문자 null로 표기 되어야 합니다.
  • 다른 오브젝트 타입일 경우 예를들면 날자나, 그외 문자열일경우 문자열로 표기되어야 합니다.
  • Each member of an object or each array value must be followed by a comma if it is not the last one
  • json 일반적 확장자는다음과 같습니다. .json
  • json파일의 MIME 타입은 다음과 같습니다. application/json

구현

JSON implementation is not very strict, and a lot of leeway is granted to the client application and/or parser to enforce the guidelines. As usual when writing code:

  • be liberal in what you accept
  • be strict (adhering to the standard) in what you send.

There are two main implementations of JSON:

일반적인 JSON 상세 구문

This implementation adheres strictly to the RFC 4627 guidelines above and does not allow deviation from the specification.

자바스크립트 구문

This implementation follows the implementation of the Javascript programming language and as such allows for a few deviations from the official specification. For example:

  1. allows un-quoted keys eg {name: "John Doe" }
  2. allows single quotes for keys and/or string values; and a liberal mix of single and double quotes eg {'name': "John Doe", "language":'Pascal'}
  3. allows trailing comma after the last member of an array and/or object eg {"keywords":["if","begin","for",], "IDEs":["Lazarus","fpIDE","MSEide"],}

같이보기