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

committee-railsとOpenAPI Generatorでスキーマ駆動なAPI開発をする

Y_uuu
April 27, 2023

committee-railsとOpenAPI Generatorでスキーマ駆動なAPI開発をする

Fusic Tech Live Vol.13:Rubyistの集い Vol.2
2023-04-27 Thu. 20:25-20:45
https://fusic.connpass.com/event/276617/

Y_uuu

April 27, 2023
Tweet

More Decks by Y_uuu

Other Decks in Programming

Transcript

  1. גࣜձࣾ'VTJD*P5νʔϜ
    Ԭቌ༤ฏ
    'VTJD5FDI-JWF7PM3VCZJTUͷू͍7PM
    DPNNJUUFFSBJMTͱ0QFO"1*(FOFSBUPSͰ

    εΩʔϚۦಈͳ"1*։ൃΛ͢Δ📝

    View full-size slide

  2. ࣗݾ঺հ


    ॴଐ
    • גࣜձࣾ'VTJD*P5νʔϜ
    • ϑΟϤϧυϒʔτΩϟϯϓϝϯλʔ

    ܦྺ
    • ؔ੢Ͱ૊ࠐΈΤϯδχΞ ʙ

    • ෱ԬͰ8FCΫϥ΢υΤϯδχΞ ʙ


    ೝఆࢿ֨
    *P5Ϋϥ΢υΤϯδχΞ
    Ԭ ቌ ༤ ฏ
    0 L B [ B L J : V I F J
    ʘ
    /&8
    ʗ

    View full-size slide

  3. 3VCZPO3BJMTΛ࢖ͬͨҊ݅4FOTPS$PSQVT*$

    • $0ηϯαʔΛ༻͍ͨײછ঱ରࡦ*P5ιϦϡʔγϣϯ
    • ηϯαʔ஋Λ"84ʹऔΓࠐΈɺμογϡϘʔυʹՄࢹԽ
    • ͜ͷμογϡϘʔυΛ3VCZPO3BJMTͰ։ൃ
    IUUQTJOGPDPSQVTDPKQQVSQPTFTFOTPSDPSQVTJD
    IUUQTGVTJDDPKQXPSLT

    View full-size slide

  4. 3VCZPO3BJMTΛ࢖ͬͨҊ݅NPDLNPDL

    • *P5։ൃʹ͓͚ΔςετΛࢧԉ͢Δ'VTJDͷࣗࣾϓϩμΫτ
    • σόΠεͷ୅ΘΓʹσʔλΛૹ৴Ͱ͖ɺ਺΍ߏ଄Λࣗ༝ʹม͑ΒΕΔ
    • ίϯιʔϧը໘Λ3VCZPO3BJMTͰ։ൃ
    IUUQTNPDLNPDLDPN

    View full-size slide

  5. 3VCZPO3BJMTΛ࢖ͬͨҊ݅/JDPMF

    • ࣾ಺χίχίΧϨϯμʔγεςϜ 'VTJDͷࣾ಺γεςϜ

    • /FYUKTͱ3VCZPO3BJMTΛ࢖ͬͨ41"Ͱ͋Γɺ3BJMT͸"1*ϞʔυͰ࡞͍ͬͯΔ
    • ࠓ೔͓࿩͢Δ಺༰ͱ࠷΋਌͍͠ߏ੒
    IUUQTUFDIGVTJDDPKQQPTUTOJDPMFSFOFXBM

    View full-size slide

  6. લఏ

    • ຊ೔͓࿩͢Δ"1*͸શͯ8FC"1*Λࢦ͠·͢
    • 3&45GVM"1*Λ૝ఆ͓ͯ͠࿩͠·͢
    • ࣗ෼΋ϕετϓϥΫςΟεΛ໛ࡧ͍ͯ͠Δͱ͜ΖͰ͢

    ΋ͬͱྑ͍ํ๏΍πʔϧ͕͋Ε͹ͥͻϑΟʔυόοΫ͍ͩ͘͞🙏

    View full-size slide

  7. ໨࣍

    3BJMTͰ"1*
    "1*εΩʔϚ
    "1*ͷςετ
    ΫϥΠΞϯτίʔυࣗಈੜ੒
    ·ͱΊ

    View full-size slide

  8. 3BJMTͰ"1*Λ࡞ͬͨ͜ͱ͸͋Γ·͔͢ʁ🙋

    View full-size slide

  9. "1*Λ࡞ΔγνϡΤʔγϣϯ

    • 'VTJDͷडୗҊ݅͸ۀ຿γεςϜ͕ଟ͍
    • 3BJMTͷϨʔϧʹ৐Δํ͕ߴ඼࣭ͳ΋ͷΛޮ཰తʹ։ൃͰ͖Δ
    IUUQTGVTJDDPKQXPSLT

    View full-size slide

  10. "1*Λ࡞ΔγνϡΤʔγϣϯ

    • ͦΕͰ΋"1*Λ࡞ΔγνϡΤʔγϣϯ͸͋Δ
    • 6*69Λॏࢹ͢΂͘41"Ͱ։ൃ͢Δͱ͖
    • ϞόΠϧΞϓϦΛఏڙ͢Δͱ͖
    • ଞγεςϜͱ࿈ܞ͢Δͱ͖
    • ඇಉظͰσʔλΛड͚౉͍ͨ͠͠ͱ͖
    • FUD
    "1*αʔό
    6*69ॏࢹͷ
    ϑϩϯτΤϯυ
    ϞόΠϧΞϓϦ
    ଞγεςϜ

    View full-size slide

  11. "1*ʹ͓͚Δ೰Έ

    ϑϩϯτΤϯυͱόοΫΤϯυͰ
    ࢓༷ͷෆҰக͕ى͜Γ͕ͪ
    +BWB4DSJQUͱ3VCZͰ

    ໋໊نଇ͕ҧ͏
    DSFBUFE@BU͔DSFBUFE"U͔

    3BJMT͚ͩͰ࡞ΔΑΓ΋
    ࣮૷ྔ͕େ͖͘ͳΔ
    ೝূͲ͏͢Δʁ ϖʔδωʔγϣϯ΍ݕࡧͲ͏͢Δʁ
    "1*Λ܁Γฦ͠ݺͿ͜ͱͰ
    ϖʔδͷද͕ࣔ஗͘ͳΓ͕ͪ

    View full-size slide

  12. "1*ʹ͓͚Δ೰Έ

    ϑϩϯτΤϯυͱόοΫΤϯυͰ
    ࢓༷ͷෆҰக͕ى͜Γ͕ͪ
    +BWB4DSJQUͱ3VCZͰ

    ໋໊نଇ͕ҧ͏
    DSFBUFE@BU͔DSFBUFE"U͔

    3BJMT͚ͩͰ࡞ΔΑΓ΋
    ࣮૷ྔ͕େ͖͘ͳΔ
    ೝূͲ͏͢Δʁ ϖʔδωʔγϣϯ΍ݕࡧͲ͏͢Δʁ
    "1*Λ܁Γฦ͠ݺͿ͜ͱͰ
    ϖʔδͷද͕ࣔ஗͘ͳΓ͕ͪ

    View full-size slide

  13. ϑϩϯτΤϯυͱόοΫΤϯυͰ࢓༷ͷෆҰக͕ى͜Γ͕ͪ
    "1*εΩʔϚΛॻ͍ͯෆҰகΛ๷͙

    View full-size slide

  14. ΠϯλʔϑΣʔε࢓༷ΛܾΊΔ͜ͱͷॏཁੑ

    • ෳ਺ͷߏ੒ཁૉ͔Β੒ΓཱͭγεςϜΛ࡞Δࡍͷమଇ
    • ·ͣΠϯλʔϑΣʔε࢓༷ΛܾΊΔ
    ߏ੒ཁૉ" ߏ੒ཁૉ#
    ΠϯλʔϑΣʔε

    View full-size slide

  15. ΠϯλʔϑΣʔε࢓༷ΛܾΊΔ͜ͱͷॏཁੑ

    • ΠϯλʔϑΣʔε࢓༷͕ܾ·͍ͬͯͳ͍ͱ
    • ૒ํ͕ಠࣗղऍͰ֤ϞδϡʔϧΛ࡞ͬͯ૊Έ߹Θͤͨͱ͖ʹ໰୊͕ੜ͡Δ
    • ૊Έ߹ΘͤΔ·Ͱ໰୊͕ݦࡏԽ͠ͳ͍ͷͰɺඞવతʹख໭Γ͕େ͖͘ͳΔ
    • ੹೚ͷॴࡏ͕ᐆດʹͳΓɺϞϝΔ
    ߏ੒ཁૉ" ߏ੒ཁૉ#
    NPPE ؾ෼
    ͔ͩΒ
    จࣈͰ౉ͤ͹͍͍ͩΖ͏
    NPPE͸FOVNͷ஋Λ
    ਺ࣈͰ౉ͯ͘͠ΕΔͩΖ͏
    1045BQJWOJLPT
    \
    lNPPEzlHPPEz
    lEBUFzlz
    ^

    View full-size slide

  16. "1*ʹ͓͚ΔΠϯλʔϑΣʔε࢓༷ʹ"1*εΩʔϚ

    • "1*εΩʔϚʹॻ͔ΕΔ৘ใ
    • 8FC"1*͕ఏڙ͢ΔΤϯυϙΠϯτ
    • "1*͕ఏڙ͢ΔϦιʔε
    • ϦΫΤετ͓ΑͼϨεϙϯεͷܗࣜ
    • ͳͲ
    ΫϥΠΞϯτ
    ϑϩϯτΤϯυ

    "1*
    όοΫΤϯυ

    1045BQJWOJLPT
    \
    lNPPEzlTUSJOHz
    lEBUFzlTUSJOHz
    ^
    "1*εΩʔϚ

    View full-size slide

  17. "1*εΩʔϚͷॻ͖ํ

    • 3&45GVMͳ"1*Ͱ͋Ε͹0QFO"1*͕Ұൠత
    • :".-͔+40/Ͱॻ͘
    • 4UPQMJHIU4UVEJP౳ͷπʔϧΛ׆༻͢Δͱָ

    View full-size slide

  18. ςετ͕ඞཁͳཧ༝

    • ࢓༷ʹԊ࣮ͬͨ૷Ͱ͋Δ͔Λ֬ೝ͢ΔͨΊ
    ΫϥΠΞϯτ
    ϑϩϯτΤϯυ

    "1*
    όοΫΤϯυ

    1045BQJWOJLPT
    \
    lNPPEzlHPPEz
    lEBUFzlz
    ^
    \
    lJEz
    lNPPEzlHPPEz
    lEBUFzlz
    lVTFS@JEz
    lDSFBUFE"Uz5
    lVQEBUFE"Uz5
    ^
    εΩʔϚʹͦͬͨϦΫΤ
    ετΛड͚෇͚Մೳ͔ʁ
    εΩʔϚʹԊͬͨϨεϙ
    ϯε͕ฦͬͯ͘Δ͔ʁ

    View full-size slide

  19. ςετࣗମ͸γϯϓϧ

    • ࣮ࡍʹϦΫΤετͯ͠ɺظ଴ͨ͠Ϩεϙϯε͕ฦΔ͜ͱΛ֬ೝ͢Ε͹ྑ͍
    • ϨεϙϯεσʔλΛࣄࡉ͔ʹ֬ೝ͢Δͷ͸େม
    • ຊདྷฦͯ͠͸͍͚ͳ͍σʔλ͕͍ࠞͬͯ͡Δ͜ͱʹؾ͖ͮʹ͍͘
    ΫϥΠΞϯτ "1*
    1045BQJWOJLPT
    \
    lNPPEzlHPPEz
    lEBUFzlz
    ^
    \
    lJEz
    lNPPEzlHPPEz
    lEBUFzlz
    lVTFS@JEz
    lDSFBUFE"Uz5
    lVQEBUFE"Uz5
    ^
    ͦΕͧΕνΣοΫ͢Δͷ͸େม

    View full-size slide

  20. DPNNJUUFFSBJMT

    • DPNNJUUFFͱ͍͏HFNΛ3BJMTʹ૊ΈࠐΈ΍ͨ͘͢͠΋ͷ
    • 0QFO"1*ͷεΩʔϚ௨ΓͷϨεϙϯε͕དྷ͍ͯΔ͔νΣοΫͰ͖Δ

    View full-size slide

  21. σϞ

    • ͜Μͳײ͡ͷςετίʔυΛॻ͘
    DPNNJUUFFSBJMT͕ఏڙ͢ΔBTTFSUϝιου

    View full-size slide

  22. σϞ

    • ฦ͍ͯ͠ΔϨεϙϯε
    • ςετ݁Ռ
    ຊདྷฦ͢΂͖NPPEΛ๨Ε͍ͯΔ
    NPPE͕ͳ͍͜ͱΛࢦఠͯ͘͠ΕΔ

    View full-size slide

  23. σϞ

    • ฦ͍ͯ͠ΔϨεϙϯε
    • ςετ݁Ռ
    εΩʔϚʹ͸ଘࡏ͠ͳ͍,FZΛฦ͢
    EVNNZ͕εΩʔϚʹ͸ଘࡏ͠ͳ͍
    ͜ͱΛࢦఠͯ͘͠ΕΔ

    View full-size slide

  24. ΫϥΠΞϯτίʔυࣗಈੜ੒

    View full-size slide

  25. ΫϥΠΞϯτͷίʔυ

    • +BWB4DSJQUͷ৔߹9.-)UUQ3FRVFTU౳Λ࢖͏͜ͱͰॻ͚Δ
    • "1*͝ͱʹ͜ΕΛॻ͘ͷ͸େม
    • 5ZQF4DSJQUΛॻ͘ͱ͖ͷܕఆ͕ٛେม

    View full-size slide

  26. 0QFO"1*(FOFSBUPS

    • 0QFO"1*ͷεΩʔϚΛݩʹίʔυΛࣗಈੜ੒Ͱ͖Δ
    • ܕఆٛ΋ࣗಈੜ੒Ͱ͖Δ

    View full-size slide

  27. σϞ

    • PQFOBQJHFOFSBUPSDMJίϚϯυΛ࣮ߦͯ͠ɺίʔυΛࣗಈੜ੒

    View full-size slide

  28. σϞ

    • ੜ੒͞ΕͨΫϥΠΞϯτΛར༻ͨ͠ίʔυ

    View full-size slide

  29. "1*ͷ։ൃ͸εΩʔϚۦಈͰ

    • όοΫΤϯυ͸ςετͰεΩʔϚ௨Γͷ࣮૷Λ୲อ
    • ϑϩϯτΤϯυ͸ࣗಈੜ੒ͰεΩʔϚ௨Γͷ࣮૷Λ୲อ
    ΫϥΠΞϯτ
    ϑϩϯτΤϯυ

    "1*
    όοΫΤϯυ

    1045BQJWOJLPT
    \
    lNPPEzlTUSJOHz
    lEBUFzlTUSJOHz
    ^
    "1*εΩʔϚ
    ςετ
    ࣗಈੜ੒
    0QFO"1*
    DPNNJUUFFSBJMT
    0QFO"1*(FOFSBUPS

    View full-size slide

  30. ࢿྉ࡞੒ʹ࢖ͬͨιʔείʔυ

    • IUUQTHJUIVCDPNZVVVOJLP@BQJ

    View full-size slide

  31. 5IBOLZPV
    'VTJDͰ͸*P5ͰੈͷதΛΞοϓσʔτ͚ͭͮ͠Δ

    ΤϯδχΞΛืू͍ͯ͠·͢
    IUUQTSFDSVJUGVTJDDPKQ

    View full-size slide