Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Swagger × Spring Cloud
Search
Hidetake Iwata
November 18, 2016
Technology
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Swagger × Spring Cloud
Spring Day 2016 Lightning Talk
http://springday2016.springframework.jp
Hidetake Iwata
November 18, 2016
Transcript
13 slides
Swagger × Spring Cloud @int128 (Hidetake Iwata)
None
Open API Specification / Swagger REST APIの仕様をJSONやYAMLで記述できる。 ツールセットが提供されている。 • Swagger
Editor(エディタ) • Swagger UI(APIコンソール) • Swagger Codegen(コード自動生成)
Swagger Codegen Swagger YAMLからいろんな言語のソースコードを自動生成する ツール。JARで提供されている。 • Java • Node.js •
PHP • などなど ※逆に、アノテーションからAPI仕様を生成する方法もある
Swagger Codegen × Spring 以下のテンプレートを選択できる: 1. spring-mvc ◦ APIサーバのControllerとModelが自動生成される ◦
Spring MVC 2. spring-cloud ◦ APIクライアントのClientとModelが自動生成される ◦ Spring Cloud Feign
自動生成コードの取り扱い 自動生成されたコードは変更しない。 JARに切り出して、ビルドツールで依存関係を張る。 地獄のパターン: • 自動生成されたコードをいじる(ControllerやModel) • API仕様が変わる • コードに変更を取り込む?
自動生成コード: • Controllerクラス ◦ ServiceクラスをDIしてメソッド実行 ◦ テンプレートをカスタマイズ • Modelクラス 実装コード:
• Serviceクラス:ビジネスロジックを実装 自動生成コードと実装コードをDIで分離
Gradle Swagger Generator Plugin Swagger YAMLからソースコードやドキュメントを生成 https://github.com/int128/gradle-swagger-generator-plugin
None
None
None
Thank you
2002年 2003年 2004年 2005年 Spring 1.0がリリースされたのはいつ?
More Decks by Hidetake Iwata
See All by Hidetake Iwata
Rewrite Go error handling using AST transformation
int128
1
1.4k
Cluster AutoscalerをTerraformとHelmfileでデプロイしてPrometheusでモニタリングする / Deploy the Cluster Autoscaler with Terraform and Helmfile, Monitor with Prometheus
int128
3
2k
認証の仕組みとclient-go credential plugin / authentication and client-go credential plugin
int128
7
8.1k
CLIでOAuth/OIDCを快適に利用する
int128
0
1k
AppEngine × Spring Boot × Kotlin
int128
0
180
いつものJIRA設定
int128
1
260
Swaggerのテンプレートを魔改造した話 / Customize Swagger Templates
int128
1
5k
本番環境のリリースを自動化した話
int128
0
870
The Evolution of System Architecture
int128
0
250
Other Decks in Technology
See All in Technology
40以上のマイクロサービスを支えるKubernetes JITアクセス — 160以上の恒久RoleBindingを削減
jumpe1
0
120
ノードが消える前提で設計する!Karpenterで金融システムを止めないためのノウハウ大全
daitak
1
270
AWS Well-Arhitected Frameworkセキュリティの柱 について
miu_crescent
PRO
2
270
Is the Website Dying?
miriamschwab
0
270
エンタープライズIAMについて - ID・権限をどう統制するか
oidfj
1
360
FPGAでアクティブセンシングがやりたくてカメラモジュールを自作した話
ryuz88
0
160
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
5
18k
VTuberになってみた話
yoshimura_datam
0
140
リリースしたで終わらない。 観測できるフロントエンド開発
yamakenji24
4
1.9k
全てを疑え!非自明な挙動と異常系から考える堅牢なカスタムコントローラ開発入門(CNDW2026)
lycorptech_jp
PRO
0
120
みん強Lightning! データ基盤ひとりでできるかな
endonanana
0
230
信頼性を犠牲にせず、PR マージからデプロイまで人の介入を完全にゼロにするまでの道のり
knwoop
4
2.3k
Featured
See All Featured
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
550
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
Heart Work Chapter 1 - Part 1
lfama
PRO
11
37k
The Curious Case for Waylosing
cassininazir
1
630
Test your architecture with Archunit
thirion
2
2.5k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
49k
Paper Plane (Part 1)
katiecoart
PRO
3
12k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
The Limits of Empathy - UXLibs8
cassininazir
2
810
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.9k
So, you think you're a good person
axbom
PRO
2
2.3k