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
920
Other Decks in Technology
See All in Technology
Codexとも仲良く。CodeRabbit CLIの紹介
moongift
PRO
1
260
FinOps について (ちょっと) 本気出して考えてみた
skmkzyk
0
170
ローカルLLMとLINE Botの組み合わせ その2(EVO-X2でgpt-oss-120bを利用) / LINE DC Generative AI Meetup #7
you
PRO
0
100
SCONE - 動画配信の帯域を最適化する新プロトコル
kazuho
1
180
物体検出モデルでシイタケの収穫時期を自動判定してみた。 #devio2025
lamaglama39
0
240
大規模サーバーレスAPIの堅牢性・信頼性設計 〜AWSのベストプラクティスから始まる現実的制約との向き合い方〜
maimyyym
10
5k
Azureコストと向き合った、4年半のリアル / Four and a half years of dealing with Azure costs
aeonpeople
1
220
なぜAWSを活かしきれないのか?技術と組織への処方箋
nrinetcom
PRO
5
1k
ビズリーチ求職者検索におけるPLMとLLMの活用 / Search Engineering MEET UP_2-1
visional_engineering_and_design
1
170
Copilot Studio ハンズオン - 生成オーケストレーションモード
tomoyasasakimskk
0
150
[Codex Meetup Japan #1] Codex-Powered Mobile Apps Development
korodroid
2
1k
AI Agent Dojo #2 watsonx Orchestrateフローの作成
oniak3ibm
PRO
0
130
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.2k
Statistics for Hackers
jakevdp
799
220k
Typedesign – Prime Four
hannesfritz
42
2.8k
Git: the NoSQL Database
bkeepers
PRO
431
66k
Side Projects
sachag
455
43k
Testing 201, or: Great Expectations
jmmastey
45
7.7k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
10
880
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
Java REST API Framework Comparison - PWX 2021
mraible
34
8.9k
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͕উͪͦ͏ʁ
νʔϜͰ͍͍͢ͷΛ ͍·͠ΐ͏
͓ΘΓ