$30 off During Our Annual Pro Sale. View Details »
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
460
プリキュアハッカソン4 成果発表 / cure_hack4
romiogaku
0
920
Other Decks in Technology
See All in Technology
ハッカソンから社内プロダクトへ AIエージェント「ko☆shi」開発で学んだ4つの重要要素
sonoda_mj
5
500
ExpoのインダストリーブースでみたAWSが見せる製造業の未来
hamadakoji
0
160
Jakarta Agentic AI Specification - Status and Future
reza_rahman
0
110
【U/day Tokyo 2025】Cygames流 最新スマートフォンゲームの技術設計 〜『Shadowverse: Worlds Beyond』におけるアーキテクチャ再設計の挑戦~
cygames
PRO
2
790
SREには開発組織全体で向き合う
koh_naga
0
380
エンジニアリングをやめたくないので問い続ける
estie
2
1.2k
品質のための共通認識
kakehashi
PRO
4
380
AWSを使う上で最低限知っておきたいセキュリティ研修を社内で実施した話 ~みんなでやるセキュリティ~
maimyyym
2
1.8k
20251218_AIを活用した開発生産性向上の全社的な取り組みの進め方について / How to proceed with company-wide initiatives to improve development productivity using AI
yayoi_dd
0
140
Database イノベーショントークを振り返る/reinvent-2025-database-innovation-talk-recap
emiki
0
240
Lessons from Migrating to OpenSearch: Shard Design, Log Ingestion, and UI Decisions
sansantech
PRO
1
150
ActiveJobUpdates
igaiga
1
140
Featured
See All Featured
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.3k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
180
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
From π to Pie charts
rasagy
0
86
Scaling GitHub
holman
464
140k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
250
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
83
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.6k
What does AI have to do with Human Rights?
axbom
PRO
0
1.9k
Building Applications with DynamoDB
mza
96
6.8k
[RailsConf 2023] Rails as a piece of cake
palkan
58
6.2k
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͕উͪͦ͏ʁ
νʔϜͰ͍͍͢ͷΛ ͍·͠ΐ͏
͓ΘΓ