User-Friendly API Publishing and Testing With Retrofit

Any web service needs to export their public API if consumers want to make the best use of that service. A developer-friendly approach to do so if you work in the Java ecosystem is to package DTOs and endpoint interfaces in an API jar file and use the Retrofit framework to create type-safe clients for integration testing. This article discusses a complete example.

If you’ve worked in enterprise Java projects you will remember good old Web Services Description Language, the XML based format for describing network services by IBM and Microsoft. Maybe you still work with it? WSDL and its twin XML Schema are among those W3C standards that seasoned developers love to hate. Its specification files are not very human readable, let alone human writable. Fortunately you don't have to. They can be generated by your server endpoint and fed straight into a code generator to create transfer objects (DTOs) and service stubs.

Benefits of Using the OpenAPI (Swagger) Specification for Your APIs

With software products becoming just a bunch of micro-services and third-party APIs mashed together, it's more crucial than ever to get their structure in order.

GraphQL already did this at its inception by coming up with a whole specification that describes how APIs of its type should behave. In the RESTful API landscape, things were a bit more wild west. However, even if not all backend devs know it, there are a number of specifications for REST APIs as well.

REST-API Versioning Strategies

REST-API Versioning Strategies

Abstract

The approach to managing Application Programming Interfaces (APIs) for distributed heterogeneous systems differs from the classic tools as offered by Apache Maven, which is designed to simplify build processes for the assembly of technologically and homogeneously similar artifacts. The limitations of such a classic dependency management tool become evident in the context of managing APIs between technologically different and independent systems, where APIs such as the Representational State Transfer (REST-APIs) ensures their networking capabilities, for instance.

The mutual contract between a service provider, which might offer a few API versions implemented, and its consumers, plays a critical role and thus demands another approach to guarantee the contract by design in operation for a prolonged period. Moreover, the semantic versioning as used by Apache Maven by differentiating three digits would be unrealistic for REST-APIs.

REST API Best Practices — Design Examples From Java and Spring Web Services

REST API Best Practices

When designing a great REST API, it's important to have great microservices. How do you design your REST API? What are the best practices?

You Will Learn

  • How do you design a great REST API?
  • What should you think about when designing a REST API?
  • What are the best practices in designing RESTful Web Services?
You may also be interested in:  Top REST API Best Practices

REST API

This is the last article in a series of articles on REST APIs: