Define a null property in OpenAPI
To define a property that can be a string or null in OpenAPI (Swagger), you use different methods depending on the OpenAPI specification version.
api tag description
View All TagsTo define a property that can be a string or null in OpenAPI (Swagger), you use different methods depending on the OpenAPI specification version.
msgspec is a high-performance serialization library designed for modern Python applications. It combines type-safe data modeling, blazing-fast parsing, and flexible support for multiple serialization formats, including MessagePack, JSON, and TOML.
This article outlines the best practices for integrating msgspec into your codebase. It provides a practical, performance-oriented guide to writing cleaner, safer, and faster Python services.
When defining server URLs in OpenAPI specs, you often need to reference environment-specific values (like staging or production subdomains). But using raw environment variables can result in placeholder values like default: unknown, which may confuse tools like Swagger UI, ReDoc, or code generators.
This guide explains the issue and offers clean solutions - with practical examples.
In high-throughput backend services and microservices, data serialization is frequently the primary CPU bottleneck. Converting incoming HTTP payloads or MessagePack buffers into validated Python objects-and marshaling domain entities back into JSON-can consume a significant portion of request processing time.
While Pydantic remains the dominant choice across the Python ecosystem, my experience building backend APIs and data pipelines has led me to evaluate alternative frameworks when hitting latency and memory constraints.
This article provides an engineering analysis of Python data serialization frameworks, evaluating their underlying compilation engines, memory characteristics, developer ergonomics, and suitability for performance-critical systems.
Pydantic is widely known for its powerful data validation and parsing capabilities using Python type hints. While it's most popular with FastAPI, it can be elegantly integrated with Flask to improve request validation, input parsing, and response formatting.
This article outlines best practices for combining Flask with Pydantic in a clean, maintainable way.