Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Swagger × Spring Cloud
Hidetake Iwata
November 18, 2016
Technology
0
59
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
970
Cluster AutoscalerをTerraformとHelmfileでデプロイしてPrometheusでモニタリングする / Deploy the Cluster Autoscaler with Terraform and Helmfile, Monitor with Prometheus
int128
3
1.3k
認証の仕組みとclient-go credential plugin / authentication and client-go credential plugin
int128
7
5.8k
CLIでOAuth/OIDCを快適に利用する
int128
0
270
AppEngine × Spring Boot × Kotlin
int128
0
64
いつものJIRA設定
int128
1
120
Swaggerのテンプレートを魔改造した話 / Customize Swagger Templates
int128
1
4k
本番環境のリリースを自動化した話
int128
0
510
The Evolution of System Architecture
int128
0
76
Other Decks in Technology
See All in Technology
小さなお葬式をAWSに移行したお話
moriryouta
2
150
AKIBA.SaaS資料
yasumuusan
0
150
re:Invent re:Cap / AWS Lambda Updates
bulbulpaul
1
140
20230117_JAWS-UG_朝会_41_LT資料
tsumita
0
290
Kubernetes Pod Probes
thockin
5
2.2k
GitHub Codespaces が拡げる開発環境、いつでもどこでも Visual Studio Code で!
dzeyelid
0
150
Oktaの管理者権限を適切に移譲してみた
shimosyan
2
220
なぜ変化を起こすのが難しいのか? - 数年以上にわたって難しさに向き合い・考え取り組んできたこと / The reason why changing organization is so hard - What I thought and faced for more than several years
iwashi86
26
17k
大企業がアジャイルになる途中で 起きること/What happens on the way big company becomes agile
chinmo
0
2.6k
UIFlowの2.0がやってきた! / ビジュアルプログラミングIoTLT vol.13
you
0
200
エンジニアリングマネージャー業の抽象度マッピング / Abstraction mapping of engineering manager's job
yoshikiiida
13
7.5k
Amazon Forecast を使って売上予測をしてみた
tomuro
0
290
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
349
27k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
15
1.2k
A Modern Web Designer's Workflow
chriscoyier
690
180k
Why Our Code Smells
bkeepers
PRO
326
55k
KATA
mclloyd
12
9.7k
Happy Clients
brianwarren
90
5.8k
Building a Modern Day E-commerce SEO Strategy
aleyda
6
4.5k
Build your cross-platform service in a week with App Engine
jlugia
221
17k
Pencils Down: Stop Designing & Start Developing
hursman
114
10k
Building an army of robots
kneath
302
40k
Gamification - CAS2011
davidbonilla
75
4.1k
What's in a price? How to price your products and services
michaelherold
233
9.7k
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がリリースされたのはいつ?