Make APIs Devs love: Give context

In this post, I wanted to give a shout out to Andy and ONETUG for a fun meetup around API design ideas this week. Andy kicked off the conversation reflecting on some specs that encourage detailed communication on happy case and failure conditions on errors. Under pressure, it’s easy for devs to provide pithy error messages.

RFC 7807, also known as Problem Details for HTTP APIs, standardizes how to convey error details in HTTP responses. It provides a consistent, machine-readable format for describing problems that occur when an API request fails. Instead of relying on custom error formats or just the HTTP status code, this RFC defines a JSON or XML structure to provide more detailed, actionable information about the error.

I really like to design stuff that’s easy to debug, diagnose and test. While the API design concept here is simple, it can have robust impacts on developer productivity. System failures are just part of the gig. As a group, we agree that these ideas can be very helpful with improving observability and distributed systems or micro-services. Since the pattern creates standards around reporting errors, front-end devs can potentially leverage the conventions while reporting errors.

I appreciate that Andy called out other tools that he enjoys for C# mobile design. I captured a few of the tools he mentioned below with a few others I discovered while chatting with Bing Copilot.

Refit: The automatic type-safe REST library for .NET from christianhelle

Refit is a REST library for .NET that simplifies the process of making REST API calls. It uses a fluent interface to define your API requests and automatically handles the serialization and deserialization of data. This makes it easier to work with REST APIs in your .NET applications and reduces boilerplate code. Refit supports multiple HTTP clients and can be easily integrated into your existing projects.

Refitter CLI from christianhelle

Refitter is a tool for generating a C# REST API Client using the Refit library. Refitter can generate the Refit interface and contracts from OpenAPI specifications. Refitter could format the generated Refit interface to be managed by Apizr (v6+) and generate some registration helpers too.

ReactiveUI / ReactiveUI from reactiveui

ReactiveUI is a composable, cross-platform MVVM framework for creating elegant, testable, and maintainable user interfaces. It’s built on top of the Reactive Extensions (Rx), allowing for asynchronous and event-driven programming. The framework supports a variety of platforms, including WPF, Xamarin, AvaloniaUI, and more. ReactiveUI promotes code reusability and simplifies complex UI interactions.

What is AvaloniaUI? from AvaloniaUI Documentation

AvaloniaUI is a free, open-source, and cross-platform UI framework for .NET. It allows developers to create modern, fluid, and visually appealing user interfaces for Windows, macOS, Linux, and Android. AvaloniaUI uses XAML for declarative UI definition and C# for the backend logic. This framework provides a consistent development experience across multiple platforms, reducing the effort needed to support various operating systems.

Marp – Markdown Presentation Writer from Marp

Marp is a Markdown presentation writer. It allows you to create presentations using Markdown, making the process simple and efficient. You can export presentations as various formats, including PDF and PPT. Marp supports various features to enhance your presentations, including themes and custom styling.

Model-View-ViewModel (MVVM) in .NET MAUI | Microsoft Learn

This document explains the Model-View-ViewModel (MVVM) design pattern and how it applies to .NET MAUI apps. MVVM helps you build maintainable and testable apps by separating concerns into three interconnected parts: the Model, the View, and the ViewModel. The Model represents the data, the View is the user interface, and the ViewModel acts as an intermediary, exposing data and commands to the View. By following the MVVM pattern, developers can improve code organization, reusability, and testability of their .NET MAUI applications.

Maui Samples from Microsoft

This GitHub repository contains a collection of sample projects demonstrating various aspects of .NET MAUI. The samples showcase features such as layouts, controls, data binding, and platform-specific integrations. Developers can use these examples to learn MAUI and build their own cross-platform applications. These samples provide a valuable resource for anyone working with .NET MAUI.

MudBlazor – Blazor Component Library from MudBlazor

MudBlazor is a free and open-source component library for Blazor. It offers a wide range of components built with Material Design in mind, providing a modern and consistent user interface. The library is actively maintained and updated, ensuring compatibility and incorporating the latest features. Developers can leverage MudBlazor to rapidly create beautiful and functional web applications.

Be the first to comment

Leave a Reply

Your email address will not be published.


*