Skip to Content
Design and Build Great Web APIs
book

Design and Build Great Web APIs

by Mike Amundsen
October 2020
Intermediate to advanced
358 pages
8h 39m
English
Pragmatic Bookshelf
Content preview from Design and Build Great Web APIs

Mocking Your API

Mocking your API is your chance to see a working version of the API up and running. SwaggerHub has a built-in API mocking service. It reads your OAS document and uses the definitions (and the example values) in that document to set up a mock API server that you can use to test against. As you may recall from the early part of this chapter in Working Prototypes, the real value of an API prototype is that it allows you to test out the interface, and mocks are an excellent way to do that.

To get the SwaggerHub API mock up and running, you need to make sure you have a server element in your OAS document that points to the SwaggerHub virtserver. We turned it on when we created our OAS file, but you can also add it later by clicking ...

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

Designing Web APIs

Designing Web APIs

Brenda Jin, Saurabh Sahni, Amir Shevat

Publisher Resources

ISBN: 9781680508123Errata Page