12 Testing and validating APIs

This chapter covers

  • Generating automatic tests for REST APIs using Dredd and Schemathesis
  • Writing Dredd hooks to customize the behavior of your Dredd test suite
  • Using property-based testing to test APIs
  • Leveraging OpenAPI links to enhance your Schemathesis test suite
  • Testing GraphQL APIs with Schemathesis

This chapter teaches you how to test and validate API implementations. Thus far, we’ve learned to design and build APIs to drive integrations between microservices. Along the way, we did some manual tests to ensure our implementations exhibited the correct behavior. However, those tests were minimal, and most importantly, they were purely manual and therefore not repeatable in an automated fashion.

In this chapter, ...

Get Microservice APIs now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.