Upgrade to Pro — share decks privately, control downloads, hide ads and more …

JSONの型のはなし

 JSONの型のはなし

2016.08.30 Fukuoka.php vol.18 〜PHP縛りなしのLT大会〜

Yusuke Hirao

August 30, 2016
Tweet

More Decks by Yusuke Hirao

Other Decks in Programming

Transcript

  1. 2016 Yusuke Hirao, CC BY-ND.
    +40/
    ͷܕͷ͸ͳ͠
    'VLVPLBQIQ7PMʙ1)1റΓͳ͠ͷ-5େձʙ

    View full-size slide

  2. 2016 Yusuke Hirao, CC BY-ND.
    +BWB4DSJQUͷ͸ͳ͠͠·͢ʂ
    ʢճ໨ʣ

    View full-size slide

  3. 2016 Yusuke Hirao, CC BY-ND.
    ࣗݾ঺հ
    ฏඌ༏యʢͻΒ͓Ώ͏ͯΜʣ
    גࣜձࣾσΟʔθϩ
    ϑϩϯτΤϯυΤϯδχΞ
    ίϛϡχςΟ׆ಈ
    ෱ԬϑϩϯτΤϯυ༑ͷձ'VLVPLB'SPOUFOE'SPHT
    ෱ԬϚʔΫΞοϓษڧձ
    CBTFS$.4Ϣʔβʔձ
    Yusuke Hirao
    @cloud10designs

    View full-size slide

  4. 2016 Yusuke Hirao, CC BY-ND.
    +40/͕ࡀʹͳΓ·ͨ͠ɻ
    ೥݄ʹ3'$Ͱ࢓༷͕نఆ

    View full-size slide

  5. 2016 Yusuke Hirao, CC BY-ND.
    ͱ͍͏͜ͱͰ
    ΋͏+40/Ͱࣦഊ͠ͳ͍ͨΊͷ
    ܕͷ͸ͳ͠

    View full-size slide

  6. 2016 Yusuke Hirao, CC BY-ND.
    +40/ͷܕ
    جຊ͸ͭ
    จࣈྻɾ਺஋ɾ࿦ཧ஋ɾ഑ྻɾΦϒδΣΫτɾOVMM
    ؾΛ͚ͭͳ͍ͱ͍͚ͳ͍͜ͱ
    ೔෇ܕ͸ͳ͍
    ྻڍܕ͸ͳ͍
    ੔਺ͱුಈখ਺఺਺͸ಉ͡਺஋ܕ
    ුಈখ਺఺ͷਫ਼౓͸ݴޠґଘ
    ΦϒδΣΫτ͸࿈૝഑ྻͱಉ͡ੑ࣭͚ͩͲγϯλοΫε͕ҧ͏
    Ωʔ͕ଘࡏ͠ͳ͍OVMM

    View full-size slide

  7. 2016 Yusuke Hirao, CC BY-ND.
    ೔෇ܕ͸ͳ͍
    ໌֬ʹϧʔϧ΋ͳ͍
    +BWB4DSJQUͷ+40/TUSJOHGZͰ͸
    *40ϑΥʔϚοτͷจࣈྻʹม׵͞ΕΔ
    1)1ͷ%BUF5JNFΫϥεͰ͸ಛʹରԠ͕ͳ͍ʁ
    Ұൠతͳղܾํ๏
    6OJYλΠϜελϯϓΛ਺஋ͱͯ͠ड͚౉͢͠Δ
    ୯Ґ͕ݴޠͰҟͳΔͷͰؾΛ͚ͭΔ
    ʢ+BWB4DSJQU͸ϛϦඵɾ1)1͸ඵʣ

    View full-size slide

  8. 2016 Yusuke Hirao, CC BY-ND.
    ྻڍܕ͸ͳ͍
    ͦΜͳ΋ͷ͸ͳ͍
    +BWB4DSJQUʹ΋ͳ͍
    +40/͸%#Ͱ͸ͳ͍

    View full-size slide

  9. 2016 Yusuke Hirao, CC BY-ND.
    ੔਺ͱුಈখ਺఺਺͸ಉ͡਺஋ܕ
    ͭ·ΓAA

    View full-size slide

  10. 2016 Yusuke Hirao, CC BY-ND.
    ුಈখ਺఺ͷਫ਼౓͸ݴޠґଘ
    ͋·Γʹ΋ࡉ͔͍਺஋ɾେ͖ͳ਺஋͸ѻ͑ͳ͍
    ղܾํ๏
    จࣈྻͱͯ͠ड͚౉͢͠Δ
    ͋ͱ͸֤ʑͷ#JH/VNCFSܥͷϥΠϒϥϦΛ࢖͏

    View full-size slide

  11. 2016 Yusuke Hirao, CC BY-ND.
    ΦϒδΣΫτ͸࿈૝഑ྻͱಉ͡ੑ࣭͚ͩͲγϯλοΫε͕ҧ͏
    <>ͱ\^
    େׅހͱதׅހ
    ΧΪׅހͱ೾ׅހ
    ΧΪׅހ͕഑ྻͰɺ೾ׅހ͕ΦϒδΣΫτ
    ͓ئ͍͔ͩΒύʔα͔͍ͭͬͯͩ͘͞
    จࣈྻ࿈݁Ͱ૊Έཱͯͳ͍Ͱ͍ͩ͘͞

    View full-size slide

  12. 2016 Yusuke Hirao, CC BY-ND.
    Ωʔ͕ଘࡏ͠ͳ͍OVMM
    ʮΩʔ͕ଘࡏ͠ͳ͍ʯ͸OVMMͱ͸ݫີʹҟͳΓ·͢
    ͔ͱݴͬͯɺVOEFpOFEͱ΋ݫີʹҧ͍·͢
    ʢ+40/ʹVOEFpOFE͸ͳ͍Ͱ͕͢ʜʣ
    ͪΌΜͱܾΊͳ͍ͱݱΕΔݸͷ഑ྻ΍ۭͷΦϒδΣΫτ
    ղܾํ๏
    OVMMͳΒOVMMɺ೚ҙσʔλͳΒ೚ҙɺͪΌΜͱܾΊΔ

    View full-size slide

  13. 2016 Yusuke Hirao, CC BY-ND.
    ͦͷଞɺؾΛ͚ͭΔ͜ͱ
    ݴޠͷจԽͷҧ͍Ͱܕͷೝ͕ࣝᐆດʹͳΔ͜ͱ͕͋Δ
    ࿦ཧ஋͸USVF͔GBMTFͰ͋ͬͯ΍͡Όͳ͍
    30Ϛούͷ͍ͤʁจࣈྻɾ਺஋ɾ࿦ཧ͕ͬͪ͝Όʹʜ
    lz͸+BWB4DSJQUͰ͸USVF
    ਺஋Λظ଴ͯ͠จࣈྻ͕͖ͯόάΛ౿Ή͜ͱ͸Α͋͘Δ
    ʢٯ΋·ͨવΓʣ

    View full-size slide

  14. 2016 Yusuke Hirao, CC BY-ND.
    ͱ͍͏ͷΛ౿·্͑ͨͰ
    ܕνΣοΧʢόϦσʔλʣΛ
    ͔͓ͭ͏ʂ

    View full-size slide

  15. 2016 Yusuke Hirao, CC BY-ND.
    +40/4DIFNB

    View full-size slide

  16. 2016 Yusuke Hirao, CC BY-ND.
    +40/4DIFNB
    +40/ͷܕϧʔϧΛ+40/Ͱॻ͍ͨ΋ͷ
    ͭͷܕͷఆٛʢෳ਺Մʣ
    ඞਢɾ೚ҙɾOVMMBCMFͷఆٛ
    ਺஋ͷ࠷େ஋ɾ࠷খ஋੍ݶ
    Մม௕ͷ഑ྻͷ੍ݶ
    ಛఆͷ஋ͷ੍ݶ
    ྻڍܕ͕ͭ͘Εͨʜʂ
    จࣈྻͷਖ਼نදݱ
    ٖࣅ೔෇ܕ΋ͭ͘ΕΔ
    ΦϒδΣΫτͷϓϩύςΟ໊ͷਖ਼نදݱ

    View full-size slide

  17. 2016 Yusuke Hirao, CC BY-ND.
    +40/4DIFNB
    +BWB4DSJQUͰͷνΣοΫπʔϧ
    jsonschema
    IUUQTXXXOQNKTDPNQBDLBHFKTPOTDIFNB
    1)1ͰͷνΣοΫπʔϧ
    justinrainbow/json-schema
    IUUQTQBDLBHJTUPSHQBDLBHFTKVTUJOSBJOCPXKTPOTDIFNB

    View full-size slide

  18. 2016 Yusuke Hirao, CC BY-ND.
    ͜ΕͰ
    όοΫΤϯυΤϯδχΞͱ
    ϑϩϯτΤϯυΤϯδχΞ͕
    ஥ྑ͘։ൃͰ͖·ͨ͠ͱ͞
    ͓ΘΓ

    View full-size slide