Api-blueprint: Nullable ν˜•μ‹μ΄ λ©”μ„œλ“œ μ„ μ–Έ λ‚΄μ—μ„œ μž‘λ™ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

에 λ§Œλ“  2016λ…„ 04μ›” 13일  Β·  3μ½”λ©˜νŠΈ  Β·  좜처: apiaryio/api-blueprint

μ„€λͺ…μ„œμ˜ μƒ˜ν”Œμ„ 따라 λ‚΄ msonμ—μ„œ nullable ν˜•μ‹ 을 μ‚¬μš©ν•˜λ €κ³  ν•˜μ§€λ§Œ 의미 였λ₯˜λ‘œ μ‹€νŒ¨ν•©λ‹ˆλ‹€.

λ‚΄ mson의 λ¬Έμ œμ™€ μ‚¬μš© 사둀에 λŒ€ν•œ μ˜¬λ°”λ₯Έ λ¬Έμ„œλ₯Ό λ§Œλ“œλŠ” 방법을 μ•Œμ•„λ‚Ό 수 μžˆλ„λ‘ λ„μ™€μ£Όμ„Έμš”.

감사 ν•΄μš”!

Apiary.io Question

κ°€μž₯ μœ μš©ν•œ λŒ“κΈ€

μ €λŠ” 이것이 이제 Apiary(베타 없이)에 λ°°ν¬λ˜μ—ˆμŒμ„ μ§€μ ν•˜κ³  μ‹ΆμŠ΅λ‹ˆλ‹€.

예λ₯Ό λ“€μ–΄ λ‹€μŒκ³Ό 같이 nullable을 μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

+ Response 200 (application/json)
    + Attributes
        + example1 (string, optional, nullable) - An example optional nullable string
        + example2: value (string, optional, nullable) - An example optional nullable string with a sample value

그러면 λ‹€μŒκ³Ό 같은 νŽ˜μ΄λ‘œλ“œμ˜ μ˜ˆκ°€ λ©λ‹ˆλ‹€.

{
  "example1": null,
  "example2": "value"
}

λ‹€μŒ JSON μŠ€ν‚€λ§ˆμ™€ ν•¨κ»˜:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "example1": {
      "type": [
        "string",
        "null"
      ],
      "description": "An example optional nullable string"
    },
    "example2": {
      "type": [
        "string",
        "null"
      ],
      "description": "An example optional nullable string with a sample value"
    }
  }
}

Apiary 의 속성 ν…Œμ΄λΈ”

screen shot 2016-06-20 at 17 46 45

λͺ¨λ“  3 λŒ“κΈ€

@danilvalovλ‹˜ , ApiaryλŠ” null ν—ˆμš© 여뢀에 λŒ€ν•œ 지원을 μΆ”κ°€ν•˜λŠ” μ΅œμ‹  λ²„μ „μ˜ API Blueprint Parserλ₯Ό μ‚¬μš©ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

Apiaryμ—λŠ” null ν—ˆμš© 여뢀에 λŒ€ν•œ 지원을 ν¬ν•¨ν•˜μ—¬ 속성 λ Œλ”λ§μ„ κ°œμ„ ν•˜κΈ° μœ„ν•œ 베타가 μžˆμŠ΅λ‹ˆλ‹€. 베타에 λŒ€ν•œ μžμ„Έν•œ λ‚΄μš©μ€ https://github.com/apiaryio/api-blueprint/issues/191#issuecomment -178044764μ—μ„œ μ°Έμ—¬ 방법과 ν•¨κ»˜ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.

λ¬Έμ•ˆ 인사,

카일

μ €λŠ” 이것이 이제 Apiary(베타 없이)에 λ°°ν¬λ˜μ—ˆμŒμ„ μ§€μ ν•˜κ³  μ‹ΆμŠ΅λ‹ˆλ‹€.

예λ₯Ό λ“€μ–΄ λ‹€μŒκ³Ό 같이 nullable을 μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

+ Response 200 (application/json)
    + Attributes
        + example1 (string, optional, nullable) - An example optional nullable string
        + example2: value (string, optional, nullable) - An example optional nullable string with a sample value

그러면 λ‹€μŒκ³Ό 같은 νŽ˜μ΄λ‘œλ“œμ˜ μ˜ˆκ°€ λ©λ‹ˆλ‹€.

{
  "example1": null,
  "example2": "value"
}

λ‹€μŒ JSON μŠ€ν‚€λ§ˆμ™€ ν•¨κ»˜:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "example1": {
      "type": [
        "string",
        "null"
      ],
      "description": "An example optional nullable string"
    },
    "example2": {
      "type": [
        "string",
        "null"
      ],
      "description": "An example optional nullable string with a sample value"
    }
  }
}

Apiary 의 속성 ν…Œμ΄λΈ”

screen shot 2016-06-20 at 17 46 45

이제 ApiaryUI μ—μ„œ λ³Ό 수 μžˆμŠ΅λ‹ˆλ‹€.
image

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰