$30 off During Our Annual Pro Sale. View Details »

10分でAmazon API GatewayにOpen API 3.0のAPI仕様をインポートする

thori
February 02, 2019

10分でAmazon API GatewayにOpen API 3.0のAPI仕様をインポートする

Gunma.web #34 スキーマ駆動開発 5分LT
AWS API Gatewayのswaggerインポートを試した

thori

February 02, 2019
Tweet

More Decks by thori

Other Decks in Technology

Transcript

  1. 10෼ͰAmazon API Gatewayʹ

    Open API 3.0ͷ

    API࢓༷ΛΠϯϙʔτ͢Δ
    Gunma.web #34 εΩʔϚۦಈ։ൃ
    Takashi Hori

    View Slide

  2. ɾງ وࢺɹɹ@t_pori418
    ɾ܈അݝࡏॅ⁵౦ژ
    ɾWebΤϯδχΞ
    ɾ޿͘ઙ͘ͳΜͰ΋΍Γ·͢

    ɾγεςϜܥ, WebαʔϏεܥ

    View Slide

  3. ࢼ͠ʹWebαΠτͷ͓໰͍߹Θͤ
    APIΛ࡞ͬͯΈΔ

    View Slide

  4. swagger editerͰyamlॻ͘

    https://editor.swagger.io/

    View Slide

  5. View Slide

  6. View Slide

  7. View Slide

  8. View Slide

  9. API GatewayͰΠϯϙʔτ
    - ϦιʔεͷΞΫγϣϯ͔ΒΠϯϙʔτ
    - ·ͨ͸৽نAPIͷ࡞੒Ͱ `Swagger͔ΒΠϯϙʔτ` Λબ୒

    View Slide

  10. Ϧιʔε͕૿͑Δ

    View Slide

  11. APIͷܨ͗ઌઃఆͱ͔΍Δ

    View Slide

  12. ࣮ߦॲཧ͸LambdaΛ࢖༻͍ͯ͠·͢
    ϝʔϧૹͬͨΓɺslack࿈ܞͨ͠Γͯ͠·͢
    ୤ઢ͢ΔͷͰؾʹͳΔํ͸ϒϩάݟ͍͚ͯͨͩΕ͹

    https://poriweb.hatenablog.com/entry/2018/12/14/073000

    View Slide

  13. OPTIONSͷํ΋΍Δ

    View Slide

  14. σϓϩΠ

    View Slide

  15. REST clientͰ࣮ߦͯ͠Έͨ

    View Slide

  16. View Slide

  17. ॴײ

    View Slide

  18. - όϦσʔγϣϯνΣοΫͷίʔυ΋

    ɹࣗಈੜ੒͍ͨ͠
    - API Gatewayͷܨ͗ઌͱ͔݁ہखͰઃఆ

    ɹͨ͠ͷͰࣗಈԽͷ࢓૊Έ࡞Γ͍ͨ͠
    API Gatewayʹͦͷ··औΓࠐΜ͚ͩͩͳͷͰ

    ɹͰ͖͍ͯͳ͍ͷ౰ͨΓલͰ͸͋Γ·͕͢…

    View Slide

  19. ·ͱΊ

    View Slide

  20. API GatewayʹΠϯϙʔτ͸

    10෼ͰͰ͖ͨʂʂʂ

    (λΠτϧʹِΓͳ͠)

    View Slide