Skip to Content
Web API: The Good Parts
book

Web API: The Good Parts

by 水野 貴明
November 2014
Intermediate to advanced
224 pages
3h 22m
Japanese
O'Reilly Japan, Inc.
Content preview from Web API: The Good Parts

5章設計変更をしやすいWeb APIを作る

Web APIは通常のウェブサービスと同様に一度公開したらそれで終わりではなく、ずっと公開していかなければ意味がありません。そして公開を続けるうちには、公開当初には想像しなかったような使われ方をされるようになったり、新たな機能要件を追加しなければならなくなったりすることも少なくありません。また、何らかの理由によりAPIの公開を止めなければならないこともあるでしょう。

本章では、その際に直面する大きな課題であるAPIの変更、および廃止に関する問題を取り扱います。

5.1 設計変更のしやすさの重要性

Web APIは何らかのアプリケーションのインターフェイスとしての役割を持ちます。そしてそのアプリケーションは、一度公開されたらずっと同じというわけにはなかなかいかず、機能の強化やバグの修正、あるいは場合によっては機能の廃止など、さまざまな状況に応じて変化していくものです。そしてその際には、そのアプリケーションの、他のアプリケーション向けのインターフェイスであるWeb APIもその影響を受けて変更をしなければならない場合があります。もちろん、サービスのちょっとした見た目の変化や、コンテンツに影響があっても、コンテンツの形式そのものに影響がないケースではAPIは更新する必要がありません。しかしデータの形式が変わったり、情報の検索に追加でパラメータが必要になったり、といった場合にはAPIの変更が必要になってきます。

たとえばテキストとして返されるデータの内容がより詳細になるとか、内部のアルゴリズムのアップデートにより検索の精度がより向上したなどの場合は、同じAPIを叩いた場合に返ってくるデータの内容は(多くの場合は改善される方向に)変化するでしょうが、データ形式が変化しないのでAPIの仕様変更は必要ありません。ウェブサービスの運営では、こうした形式は変わらないけれども内容がより改善される、といったことは日々発生します。 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Principles of Web API Design: Delivering Value with APIs and Microservices

Principles of Web API Design: Delivering Value with APIs and Microservices

James Higginbotham
API Design Patterns

API Design Patterns

John J. Geewax
Designing APIs with Swagger and OpenAPI

Designing APIs with Swagger and OpenAPI

Lukas Rosenstock, Joshua Ponelat
Mastering API Architecture

Mastering API Architecture

James Gough, Daniel Bryant, Matthew Auburn

Publisher Resources

ISBN: 9784873116860Other