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
APIドキュメント標準化現状確認 / standard api document
Search
mat
June 15, 2016
Technology
0
13k
APIドキュメント標準化現状確認 / standard api document
Excite Japan Co., Ltd.
Lightning Talks
mat
June 15, 2016
Tweet
Share
More Decks by mat
See All by mat
Amazon Echoのウェイクワードをカスタマイズする / Customize Amazon Echo Wake Word
romiogaku
0
450
プリキュアハッカソン4 成果発表 / cure_hack4
romiogaku
0
910
Other Decks in Technology
See All in Technology
Amazon Bedrockで実現する 新たな学習体験
kzkmaeda
2
540
Liquid Glass革新とSwiftUI/UIKit進化
fumiyasac0921
0
210
生成AI時代の開発組織・技術・プロセス 〜 ログラスの挑戦と考察 〜
itohiro73
0
110
初めてのAzure FunctionsをClaude Codeで作ってみた / My first Azure Functions using Claude Code
hideakiaoyagi
1
220
生成AIで小説を書くためにプロンプトの制約や原則について学ぶ / prompt-engineering-for-ai-fiction
nwiizo
4
1.4k
登壇ネタの見つけ方 / How to find talk topics
pinkumohikan
4
390
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
26k
_第3回__AIxIoTビジネス共創ラボ紹介資料_20250617.pdf
iotcomjpadmin
0
150
Node-REDのFunctionノードでMCPサーバーの実装を試してみた / Node-RED × MCP 勉強会 vol.1
you
PRO
0
110
GeminiとNotebookLMによる金融実務の業務革新
abenben
0
230
How Community Opened Global Doors
hiroramos4
PRO
1
120
「Chatwork」の認証基盤の移行とログ活用によるプロダクト改善
kubell_hr
1
150
Featured
See All Featured
Site-Speed That Sticks
csswizardry
10
660
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
124
52k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
BBQ
matthewcrist
89
9.7k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.8k
Typedesign – Prime Four
hannesfritz
42
2.7k
Bash Introduction
62gerente
614
210k
It's Worth the Effort
3n
185
28k
Faster Mobile Websites
deanohume
307
31k
The Invisible Side of Design
smashingmag
299
51k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
Transcript
APIυΩϡϝϯτඪ४Խ ݱঢ়֬ೝ ϝϯόʔγοϓαʔϏεຊ෦ ࿀Ѫ݁ࠗɾ࿀׆ٕज़ηΫγϣϯ দԼ
API༷ॻ͘ͱ͖ Ͳ͏ͯ͠·͔͢ʁ
ԿͰॻ͘ʁ • Markdown • Githubͷwiki • Confluence • excel •
word
ԿΛॻ͘ʁ • HTTPϝιουʢGET/POST/PUT/DELETE…ʣ • ΤϯυϙΠϯτ • ϦΫΤετύϥϝʔλ • Ϩεϙϯε •
αϯϓϧ
ߏͱऍ
ຊޠ/ӳޠͰॻ͘ʹ ੍͕ແ͗͢͞Δ
༷ॻͷݟ͢͞ ॻ͖खʹࠨӈ͞ΕΔ
APIυΩϡϝϯτΛ هड़͢Δҝͷ ϧʔϧ/ݴޠ͕ඞཁͩ
APIυΩϡϝϯτΛ هड़͢Δҝͷ ϧʔϧ/ݴޠΛ౷Ұ͠Α͏
http://techslides.com/top-10-free-templates-for-api-documenation
͍Ζ͍ΖͰ͖ͯͨ
APIυΩϡϝϯτ ࡾॐ࢜Λ࿈Ε͖ͯͨΑ
ࠓͳΒ͜ͷ3͔ͭ • API Blueprint • RAML • Swagger
ͬ͘͟ͱղઆ͠·͢
ྫɿϒϩάهࣄৄࡉऔಘAPI ϦΫΤετ )551ϝιου ΤϯυϙΠϯτ ϦΫΤετ ύϥϝʔλ ϦΫΤετ ϔομ (&5 WBSUJDMF\BSUJDMF@JE^
BSUJDMF@JE ʢඞਢʣ $POUFOU5ZQFBQQMJDBUJPOKTPO "DDFQUBQQMJDBUJPOKTPO
{ "data": { "id": 3, "title": "هࣄλΠτϧ", "body": "<html>HTMLຊจ</html>", "created_at":
"2016-05-22T14:56:29.000Z", "updated_at": "2016-05-22T14:56:28.000Z", "author": "author1", "tags": [ {"id": 1, "tag_name": "λά໊1"}, {"id": 2, "tag_name": "λά໊2"} ] } } ྫɿϒϩάهࣄऔಘAPI Ϩεϙϯε(200)
API Blueprint
API Blueprint • MarkdownΛ֦ுͨ͠هड़ • JSON SchemaཪͰ࡞ͬͯ͘ΕΔ • JSON SchemaɿJSONσʔλߏΛهड़͢Δ
ͨΊͷॻࣜɾ༷ʢࠓճ৮Ε·ͤΜʣ
+ Request (application/json) + Headers Accept: application/json + Parameters +
article_id: 3 (number, required) + Response 200 (application/json) + Attributes + data (required) + id: 3 (number, required) + title: هࣄλΠτϧ (string, required) + body: `<html>HTMLຊจ</html>`(string, required) + created_at: `2016-05-22T14:56:29.000Z` (string, required) + updated_at: `2016-05-22T14:56:28.000Z` (string, required) + author: author1 (string, required) -- هࣄຖʹҰਓͷϢʔβʢஶऀʣ + tags (array) -- هࣄຖʹෳͷλά + (object) + id: 1 (number, required) + tag_name: λά1 (string, required) + (object) + id: 2 (number, required) + tag_name: λά2 (string, required) blog.apib(Ұ෦ൈਮ)
API Blueprint • Markdownͱݴ͍ͭͭบ͕͋Δ • ҰͭͰॻ͚ίϐϖͰͳΜͱ͔ͳΔ • ϑΝΠϧׂػೳ͕ͳ͍ͷͰͪ͜ΒͰ݁߹͢ ΔͳΓ͢Δඞཁ͕͋Δ •
APIυΩϡϝϯτੜπʔϧͷapiary͕༏ल
None
None
None
RAML
RAML • YAMLΛ֦ுͨ͠ه๏ • ڞ௨෦Λ࠶ར༻ͨ͠ΓɺଞͷϑΝΠϧ͔Β includeͨ͠ΓͰ͖Δ
schemas: - article: !include sampleblog-include-article.schema resourceTypes: - collection-item: description: Entity
representing a <<resourcePathName|!singularize>> get: responses: 200: body: application/json: schema: <<resourcePathName|!singularize>> example: | <<exampleItem>> /article: /{article_id}: uriParameters: article_id: description: هࣄID type: integer required: true example: 3 type: collection-item: exampleItem: !include sampleblog-include-article-item.sample description: هࣄ୯ମ get: description: هࣄৄࡉΛऔಘ͢ΔɻهࣄݸผϖʔδͰ༻͠ɺهࣄຖͷauthor,tagใฦ٫͢Δ blog.raml(Ұ෦)
schemas: - article: !include sampleblog-include-article.schema resourceTypes: - collection-item: description: Entity
representing a <<resourcePathName|!singularize>> get: responses: 200: body: application/json: schema: <<resourcePathName|!singularize>> example: | <<exampleItem>> /article: /{article_id}: uriParameters: article_id: description: هࣄID type: integer required: true example: 3 type: collection-item: exampleItem: !include sampleblog-include-article-item.sample description: هࣄ୯ମ get: description: هࣄৄࡉΛऔಘ͢ΔɻهࣄݸผϖʔδͰ༻͠ɺهࣄຖͷauthor,tagใฦ٫͢Δ blog.raml(Ұ෦)
schemas: - article: !include sampleblog-include-article.schema resourceTypes: - collection-item: description: Entity
representing a <<resourcePathName|!singularize>> get: responses: 200: body: application/json: schema: <<resourcePathName|!singularize>> example: | <<exampleItem>> /article: /{article_id}: uriParameters: article_id: description: هࣄID type: integer required: true example: 3 type: collection-item: exampleItem: !include sampleblog-include-article-item.sample description: هࣄ୯ମ get: description: هࣄৄࡉΛऔಘ͢ΔɻهࣄݸผϖʔδͰ༻͠ɺهࣄຖͷauthor,tagใฦ٫͢Δ blog.raml(Ұ෦)
RAML • Լखʹܧঝ͕ؔఆٛͰ͖Δ͍ͤͰপʹ·Γͦ͏ • yamlͰແཧ͠ա͗Ͱɾɾɾʁ • 0.8ͱ1.0Ͱهड़݁ߏҧ͏ • json schemaͷ༷͓ͬͯ͘ඞཁ͕͋Δ
• apiaryʹࣅͨʮAPI Designerʯͱ͍͏αʔϏε͕͑Δ • AtomϓϥάΠϯ(API Workbench)͋Γ·͢
Swagger
Swagger • 3ͭͷதͰ࠷ݹࢀ • ༷ˠ࣮ͷτοϓμϯɺɹɹɹɹɹɹɹ ࣮ˠ༷ͷϘτϜΞοϓͷ྆ํʹରԠ • JSON͔YAMLͰ༷(Swagger Spec)Λॻ͘
swagger: '2.0' host: sampleblog.com basePath: /v1 paths: /article/{article_id}: get: summary:
هࣄৄࡉ description: | هࣄৄࡉΛऔಘ͢ΔɻهࣄݸผϖʔδͰ༻͠ɺهࣄຖͷauthor,tagใฦ٫͢Δ parameters: - name: article_id in: path description: هࣄID required: true type: number tags: - Article responses: 200: description: هࣄৄࡉ schema: $ref: '#/definitions/Article' swagger.yaml(Ұ෦)
swagger: '2.0' host: sampleblog.com basePath: /v1 paths: /article/{article_id}: get: summary:
هࣄৄࡉ description: | هࣄৄࡉΛऔಘ͢ΔɻهࣄݸผϖʔδͰ༻͠ɺهࣄຖͷauthor,tagใฦ٫͢Δ parameters: - name: article_id in: path description: هࣄID required: true type: number tags: - Article responses: 200: description: هࣄৄࡉ schema: $ref: '#/definitions/Article' swagger.yaml(Ұ෦)
definitions: Article: type: object required: - id - title -
body - created_at - updated_at - author - tags properties: id: type: number description: هࣄID title: type: string description: هࣄλΠτϧ body: type: string description: HTMLຊจ created_at: type: string format: datetime description: ࡞࣌ updated_at: type: string format: datetime description: ߋ৽࣌ author: type: string swagger.yaml(ଓ͖,Ұ෦ൈਮ)
Swagger • ؔ࿈πʔϧ͕ଟ͘ɺ3ͭͷதͰҰ൪ଟػೳ • ͱ͖ͬͭʹ͘͞No.1 • มʹڽͬͯͳ͍ͷͰ͍֮͑͢ʢͱࢥ͏ʣ • ʮSwagger CodegenʯͰαʔόStub/ΫϥΠΞϯτίʔυΛ
ు͖ग़ͤΔ • BetaͰapiaryରԠ͍ͯ͠Δ͕ɺʮSwagger Editorʯ͕͑Δ
None
ͲΕΛ͑ɾɾɾ
͍ͷʹר͔Ε·͠ΐ͏
GoogleτϨϯυ
Open API Initiative • RESTFul APIͷΠϯλʔϑΣʔεΛهड़͢Δͨ Ίͷඪ४ϑΥʔϚοτΛਪਐ͢Δஂମ • 2015ɺLinux FoundationڠྗͷԼ݁
• SwaggerΛ࠾༻
Open API Initiative
Swagger͕উͪͦ͏ʁ
νʔϜͰ͍͍͢ͷΛ ͍·͠ΐ͏
͓ΘΓ