SShortSingh.
Back to feed

How to Use JSON Schema Validation in Postman for API Contract Testing

0
·2 views

API responses can silently change structure over time — a field type shift or missing property can break client apps without triggering standard value-based test assertions. JSON Schema validation in Postman, powered by the built-in ajv validator, catches these structural changes systematically across all endpoints in roughly ten lines of script. Developers can define a schema once as a collection variable and reuse it across multiple requests such as /users, /login, and /teams/:id/members, ensuring consistent response shapes throughout an API. Key schema rules include always listing required fields explicitly, distinguishing between integer and number types, and using pattern or enum constraints to flag unexpected values early. This approach turns schema validation into centralized contract testing, meaning a single schema update propagates across every endpoint test simultaneously.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Transformers 5.15.0 and Meta Muse Glimmer Lead Latest AI Releases

A review of eleven recent AI and agent updates found only two meeting a strict 36-hour recency threshold. Meta Muse Glimmer is a roughly 30-billion-parameter multimodal model released under Apache 2.0, designed for agentic workloads with 4-bit weights reportedly under 20 GB. Hugging Face's Transformers 5.15.0 adds support for Muse Glimmer, FSDP plans across 94 causal-LM classes, batched Omni audio generation, and Tekken tokenizer support. The update also introduces notable breaking changes, including opt-in kernels for linear-attention families and revised cache-cropping behavior using negative offsets. Six additional tools — including SGLang 0.5.17, Anthropic Python SDK 0.121.0, and Pydantic AI 2.27.0 — are flagged for a broader 72-hour watchlist pending further verification.

0
ProgrammingDEV Community ·

Developer Builds Custom JavaScript Promise Class to Demystify Async Internals

A developer published a tutorial on DEV Community explaining how to implement a custom Promise class in JavaScript from scratch. The project, called MyPromise, is modeled on the core principles of the Promises/A+ specification and replicates key native Promise behaviors. The implementation covers Promise states, resolve and reject functions, callback queuing, chaining, error propagation, and asynchronous execution of .then() handlers. A companion test suite was built to compare the custom implementation's behavior directly against JavaScript's native Promise object. The goal is to help developers move beyond treating Promise as a black box and gain a deeper understanding of how asynchronous JavaScript works internally.

0
ProgrammingDEV Community ·

SQLite FTS5 Outperforms Whoosh, But Pure-Python Search Still Has a Place

An AI agent maintaining the whoosh3 Python search library published benchmarks showing SQLite FTS5 indexes and searches roughly 76–78 times faster than Whoosh on a 5,000-document test corpus. The author openly concedes FTS5's speed advantage, attributing it to being a compiled C extension versus pure Python. However, Whoosh remains relevant in environments where FTS5 is unavailable, such as locked-down enterprise systems or minimal containers that ship SQLite without the FTS5 option enabled. Whoosh also offers a richer query model with built-in support for fuzzy matching, wildcards, field-scoped terms, spelling correction, and result highlighting — features that would require custom implementation on top of FTS5. The article concludes that complex search UIs and constrained deployment environments are the clearest practical reasons to choose Whoosh over FTS5.

0
ProgrammingDEV Community ·

Developer Replaces Gut-Feel Model Testing with Automated 30-Minute Scoring Loop

A developer frustrated by unreliable informal testing of open-source AI models built a structured evaluation system to replace instinct-based assessments. The core problem identified was threefold: single prompts are unrepresentative, recent demos create anchoring bias, and fluent-sounding wrong answers feel deceptively correct. The solution uses a JSONL task file containing real-world prompts drawn from actual past work, split into auto-scored code tasks verified by assertion checks and manually rubric-scored tasks judged against criteria written before any output is seen. A lightweight Python runner, requiring no third-party libraries, executes the full suite against any OpenAI-compatible endpoint and produces a written verdict rather than a subjective impression. The author argues the entire evaluation loop fits within a coffee break and eliminates the inconsistency of mood-driven model adoption decisions.