Skip to Content
Designing APIs with Swagger and OpenAPI
book

Designing APIs with Swagger and OpenAPI

by Lukas Rosenstock, Joshua Ponelat
June 2022
Intermediate to advanced
424 pages
11h 50m
English
Manning Publications
Content preview from Designing APIs with Swagger and OpenAPI

18 Supporting the unhappy path: Error handling with problem+json

This chapter covers

  • Finding and categorizing API errors
  • The error-handling format from the OAS tools library
  • The problem+json format
  • Adding error responses to the PetSitter OpenAPI definition

As we have designed and implemented the PetSitter API, we’ve mostly looked at the happy path, which is when everything works according to plan and things are 200 OK. Obviously we want the interactions between our API and its users to be on this path as often as possible, but we cannot always guarantee that. In this chapter we’ll look at the ways things can go wrong and how to handle those situations.

The OpenAPI definition of an API is a contract that both sides, client and server, have to ...

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.
Start your free trial

You might also like

Design and Build Great Web APIs

Design and Build Great Web APIs

Mike Amundsen
Mastering API Architecture

Mastering API Architecture

James Gough, Daniel Bryant, Matthew Auburn

Publisher Resources

ISBN: 9781617296284Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentErrata PagePurchase Link