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

First step of OpenAPI

Eabc3d48a76f6827e35a4cd0a44008b3?s=47 ゆるゆる
September 24, 2021

First step of OpenAPI

技育CAMP 2021-09 で発表した内容です
https://talent.supporterz.jp/events/c01ce860-9f20-40ce-8d6b-46b14e1b3f25/

Eabc3d48a76f6827e35a4cd0a44008b3?s=128

ゆるゆる

September 24, 2021
Tweet

Transcript

  1. OpenAPI͜ͱ͸͡Ί ٕҭCAMP 2021/09/24 @sun-yryr / גࣜձࣾΏΊΈ

  2. ΏΔΏΔ / sun-yryr / @taittide w גࣜձࣾΏΊΈ৽ଔೖࣾ w 4FSWFSTJEF&OHJOFFS 1)1

    /PEFKT ΍ͬͯ·͢ɻ GitHub Twitter ܦྺ ޷͖ͳ͜ͱ w 4XJGU 4FSWFSTJEF $*$% w 75VCFS taittide sunyryr
  3. ΋͘͡ • OpenAPI / Swaggerͱ͸ • ͳͥOpenAPIΛ࢖͏ͷ͔ • OASͷߏ଄ •

    OpenAPI͔Βίʔυͷࣗಈੜ੒ʹ͍ͭͯ
  4. OpenAPI / Swaggerͱ͸ • REST APIͷهड़ϑΥʔϚοτ • yaml or jsonͰهड़Ͱ͖Δ

    • Ұੲલ·Ͱ͸Swagger Speci fi cation͕ଘࡏ͍ͯͨ͠ 
 ͜ΕΛݩʹ֦ு͞Εͯݱࡏ࢖ΘΕ͍ͯΔͷ͕OpenAPI(Speci fi cation) • ݱࡏόʔδϣϯ3
  5. OpenAPI / Swaggerͱ͸ • OAS(OpenAPI Speci fi cation) Λิॿ͢Δπʔϧͷ૯শ •

    Swagger Editor (هड़ɾม׵) • Swagger UI (දࣔ) • Swagger Codegen (ίʔυੜ੒)
  6. ͳͥ࢖͏ͷ͔ • ࢓༷͕ݟ΍͍͢ • ΄΅ελϯμʔυʹͳ͖͍ͬͯͯΔͷͰڞ༗͕͠΍͍͢ • ίʔυͷࣗಈੜ੒͕ศར͗͢Δ • ϓϩάϥϜͰѻ͍΍͍͢

  7. ͳͥ࢖͏ͷ͔ • ࢓༷͕ݟ΍͍͢ • ΄΅ελϯμʔυʹͳ͖͍ͬͯͯΔͷͰڞ༗͕͠΍͍͢ • ίʔυͷࣗಈੜ੒͕ศར͗͢Δ • ϓϩάϥϜͰѻ͍΍͍͢

  8. ͳͥ࢖͏ͷ͔ • ࢓༷͕ݟ΍͍͢ • ΄΅ελϯμʔυʹͳ͖͍ͬͯͯΔͷͰڞ༗͕͠΍͍͢ • ίʔυͷࣗಈੜ੒͕ศར͗͢Δ • ϓϩάϥϜͰѻ͍΍͍͢

  9. ͳͥ࢖͏ͷ͔ • ࢓༷͕ݟ΍͍͢ • ΄΅ελϯμʔυʹͳ͖͍ͬͯͯΔͷͰڞ༗͕͠΍͍͢ • ίʔυͷࣗಈੜ੒͕ศར͗͢Δ • ϓϩάϥϜͰѻ͍΍͍͢

  10. ͳͥ࢖͏ͷ͔ • ࢓༷͕ݟ΍͍͢ • ΄΅ελϯμʔυʹͳ͖͍ͬͯͯΔͷͰڞ༗͕͠΍͍͢ • ίʔυͷࣗಈੜ੒͕ศར͗͢Δ • ϓϩάϥϜͰѻ͍΍͍͢

  11. https://fortee.jp/phpcon-2021/proposal/5a58e077-6de6-453a-abff-adbe24cc3156

  12. OASͷߏ଄

  13. • openapi (όʔδϣϯ) • info (৘ใ) • servers (ϕʔεURL) •

    paths (ΤϯυϙΠϯτ) • components (࠶ར༻ՄೳͳΦϒδΣΫτ) • tags (λά)
  14. info ར༻ن໿

  15. servers

  16. paths

  17. components

  18. None
  19. tags

  20. OpenAPI͔Βίʔυͷࣗಈੜ੒

  21. Swagger Codegen language: dart, csharp, go, java, python, ruby, php,

    swift5, typescript-fetch, javascript, etc…
  22. Swagger Codegen ੜ੒͞ΕΔϑΝΠϧ ར༻αϯϓϧ

  23. Swagger Codegen service/AService.js

  24. OpenAPIͷΤίγεςϜͰ ։ൃΛศརʹ͍͖ͯ͠·͠ΐ͏ʂ

  25. ͓͠·͍