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
Android Audio: Beyond Winning On It
atsushieno
0
2.4k
AI時代を生き抜くエンジニアキャリアの築き方 (AI-Native 時代、エンジニアという道は 「最大の挑戦の場」となる) / Building an Engineering Career to Thrive in the Age of AI (In the AI-Native Era, the Path of Engineering Becomes the Ultimate Arena of Challenge)
jeongjaesoon
0
210
「Linux」という言葉が指すもの
sat
PRO
4
140
Automating Web Accessibility Testing with AI Agents
maminami373
0
1.3k
まずはマネコンでちゃちゃっと作ってから、それをCDKにしてみよか。
yamada_r
2
120
エンジニアリングマネージャーの成長の道筋とキャリア / Developers Summit 2025 KANSAI
daiksy
2
450
テストを軸にした生き残り術
kworkdev
PRO
0
210
Unlocking the Power of AI Agents with LINE Bot MCP Server
linedevth
0
110
Snowflake Intelligenceにはこうやって立ち向かう!クラシルが考えるAI Readyなデータ基盤と活用のためのDataOps
gappy50
0
270
2つのフロントエンドと状態管理
mixi_engineers
PRO
3
110
自作JSエンジンに推しプロポーザルを実装したい!
sajikix
1
190
新規プロダクトでプロトタイプから正式リリースまでNext.jsで開発したリアル
kawanoriku0
1
160
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.5k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
Automating Front-end Workflow
addyosmani
1370
200k
Raft: Consensus for Rubyists
vanstee
140
7.1k
It's Worth the Effort
3n
187
28k
Into the Great Unknown - MozCon
thekraken
40
2k
Being A Developer After 40
akosma
90
590k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.5k
The Power of CSS Pseudo Elements
geoffreycrofte
77
6k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
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͕উͪͦ͏ʁ
νʔϜͰ͍͍͢ͷΛ ͍·͠ΐ͏
͓ΘΓ