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
信頼性を犠牲にせず、PR マージからデプロイまで人の介入を完全にゼロにするまでの道のり
knwoop
4
2.3k
Metadata - Section 4 : MODS (Metadata Object Description Schema )
mohab1
0
200
VTuberになってみた話
yoshimura_datam
0
140
AI時代の開発組織における、QAの体制とロールの再設計
sansantech
PRO
0
100
【Oracle AI SPOTLIGHT ウェビナー】AI時代、狙われるデータと止められない業務をどう守るか?
oracle4engineer
PRO
1
170
Well, that’s weird…
csswizardry
3
260
新規事業開発でのAWS活用成功談&失敗談! 〜新規事業開発を専門に行うRelicならではのAWS活用〜
amixedcolor
1
170
生成AIによる情報システムへのインパクト (2026年11月版)
taka_aki
0
130
技術同人誌を作る方法
yoshimura_datam
0
120
Is the Website Dying?
miriamschwab
0
270
猫でもわかるKiro初心者編(2026年11月版)
kentapapa
1
130
NutanixへのSSHアクセスの今後について
shadowhat
0
190
Featured
See All Featured
The Invisible Side of Design
smashingmag
301
52k
A Tale of Four Properties
chriscoyier
163
24k
Become a Pro
speakerdeck
PRO
31
6.4k
From π to Pie charts
rasagy
1
460
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
300
Documentation Writing (for coders)
carmenintech
77
5.7k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
73
43k
KATA
mclloyd
PRO
35
16k
Embracing the Ebb and Flow
colly
88
5.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3.1k
4 Signs Your Business is Dying
shpigford
187
23k
What the history of the web can teach us about the future of AI
inesmontani
PRO
3
840