Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Swagger × Spring Cloud
Search
Hidetake Iwata
November 18, 2016
Technology
0
77
Swagger × Spring Cloud
Spring Day 2016 Lightning Talk
http://springday2016.springframework.jp
Hidetake Iwata
November 18, 2016
Tweet
Share
More Decks by Hidetake Iwata
See All by Hidetake Iwata
Rewrite Go error handling using AST transformation
int128
1
1.1k
Cluster AutoscalerをTerraformとHelmfileでデプロイしてPrometheusでモニタリングする / Deploy the Cluster Autoscaler with Terraform and Helmfile, Monitor with Prometheus
int128
3
1.5k
認証の仕組みとclient-go credential plugin / authentication and client-go credential plugin
int128
7
6.8k
CLIでOAuth/OIDCを快適に利用する
int128
0
550
AppEngine × Spring Boot × Kotlin
int128
0
71
いつものJIRA設定
int128
1
150
Swaggerのテンプレートを魔改造した話 / Customize Swagger Templates
int128
1
4.4k
本番環境のリリースを自動化した話
int128
0
620
The Evolution of System Architecture
int128
0
140
Other Decks in Technology
See All in Technology
サービス開発におけるVue3とTypeScriptの親和性について
tsukuha
10
1.8k
エムスリーQAチーム紹介資料 / Introduction of M3 QA Team
m3_engineering
1
320
グイグイ系QAエンジニアでやっていくよ!
____rina____
0
760
知識と実践を紡ぐGenAI / Connecting Knowledge and experience with GenAI
aki_moon
2
180
LINEヤフーのウェブアクセシビリティ
lycorptech_jp
PRO
2
170
Google Cloudを組織(企業)で運用する時のベストプラクティス × 健康の環境分離戦略 #まるクラ勉強会
yasumuusan
0
170
生成AIがもたらす変革 / GitHubGalaxy_CyberAgent
cyberagentdevelopers
PRO
2
110
.NET GraphQL Client のリアル
sansantech
PRO
1
230
1Q86
kawaguti
PRO
2
190
PHP 9 に備えよ - 動的プロパティ、どうすればいぃ?
taisukearase
0
310
Autonomous Database Cloud 技術詳細 / adb-s_technical_detail_jp
oracle4engineer
PRO
15
36k
[PyconUS 2024] Having fun with Pydantic and pattern matching
enforcerpl
0
160
Featured
See All Featured
Building Effective Engineering Teams - LeadDev
addyosmani
33
1.9k
Git: the NoSQL Database
bkeepers
PRO
423
63k
Adopting Sorbet at Scale
ufuk
69
8.6k
Imperfection Machines: The Place of Print at Facebook
scottboms
261
12k
How to name files
jennybc
65
94k
Designing for humans not robots
tammielis
247
25k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
51k
Designing for Performance
lara
601
67k
A Tale of Four Properties
chriscoyier
153
22k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
26
2.3k
Faster Mobile Websites
deanohume
300
30k
Agile that works and the tools we love
rasmusluckow
325
20k
Transcript
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がリリースされたのはいつ?