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

Overview: Swift OpenAPI Generator

ojun
January 25, 2024

Overview: Swift OpenAPI Generator

ojun

January 25, 2024
Tweet

More Decks by ojun

Other Decks in Technology

Transcript

  1. ࠓ೔ൃද͢Δ͜ͱ • Swift OpenAPI Generator ͷ overview • αʔόଆ &

    ΫϥΠΞϯτଆͷ࣮૷ • ΞϓϦ։ൃͷࡍʹඞཁʹͳΔ͜ͱ • APIClientͷӅṭ • Headerͷ஫ೖ • Middlewareͷਂ۷Γ
  2. • Swift OpenAPI Generator ͷ overview • αʔόଆ & ΫϥΠΞϯτଆͷ࣮૷

    • ΞϓϦ։ൃͷࡍʹඞཁʹͳΔ͜ͱ • APIClientͷӅṭ • Headerͷ஫ೖ • Middlewareͷਂ۷Γ ࠓ೔ൃද͢Δ͜ͱ “https://developer.apple.com/videos/play/wwdc2023/10171/"ΑΓҾ༻
  3. Swift OpenAPI Generator ͱ͸ʁ • AppleʹΑͬͯ։ൃ͞Εͨ Swift Package Plugin •

    OpenAPIυΩϡϝϯτ͔ΒSwiftͷΫϥΠΞϯτ͓ΑͼαʔόʔίʔυΛ ੜ੒͢Δ͜ͱ͕Մೳ • OpenAPI ͷ 3.0 ͱ 3.1 Ͱಈ࡞͢Δ
  4. Swift OpenAPI Generatorͷಛ௃ • Swift Package Plugin • Ϗϧυ࣌ʹҎԼ͕ίʔυੜ੒͞ΕΔ •

    Type safe ͳϓϩύςΟ • ೖग़ྗͷΤϯίʔυɾσίʔυॲཧ • ϦΫΤετͷੜ੒
  5. Swift OpenAPI GeneratorͷӅṭ • ݱࡏͷ࣮૷Ͱ͸ɺར༻ଆ͕ Swift OpenAPI Generator ʹґଘͨ͠ϝιο υΛ௚઀ݺͼग़͍ͯ͠Δ

    → ར༻ऀ͕Generatorͷ࣮૷ͷৄࡉΛ஌Δඞཁ͕͋Δ • ͜Εղܾ͢ΔͨΊʹɺ৽͍͠ߏ଄ମΛಋೖ͠ɺSwift OpenAPI Generator ͷػೳΛϥοϓ͢Δ • ͜ΕʹΑΓSwift OpenAPI Generator΁ͷ௚઀తͳґଘؔ܎͕Ӆṭ͞Εɺ APIͷ࢖༻͕ΑΓγϯϓϧʹͳΔ
  6. Transport • ࣮ࡍʹωοτϫʔΫΛ࢖༻͠ɺHTTPૢ࡞Λ࣮ߦ͢Δ(جຊͱͳΔ)HTTP ϥΠϒϥϦΛந৅Խ͢Δ • ҎԼͷ2ͭͷ৔߹͸ custom transport ͷ࣮૷Λݕ౼͢Δͱྑ͍ •

    ޷ΈͷHTTPϥΠϒϥϦʹରԠ͢ΔΫϥΠΞϯττϥϯεϙʔτ͕·ͩ ଘࡏ͠ͳ͍৔߹ • ςετͰ௝͍͠ωοτϫʔΫ৚݅ΛγϛϡϨʔτ͢Δඞཁ͕͋Δ৔߹
  7. 1

  8. 1 2