Urgent.News

What's breaking now, across thousands of outlets.

Tech

Insomnia's Nunjucks Template Tags vs Declarative Spec Values

Quick answer: Insomnia uses Nunjucks template tags to inject dynamic values like timestamps, random IDs, or variables into request fields. They are powerful for ad hoc dynamic requests, but the logic is embedded in a client-specific string syntax that does not travel with an OpenAPI contract. A declarative spec describes values, defaults, and constraints as data, which any tool can read. Use…

Insomnia's Nunjucks template tags inject dynamic values such as timestamps, random IDs, and variables into requests. These tags are powerful for one-off client behavior but are tied to the client and harder to validate. In contrast, declarative spec values are described in an OpenAPI schema, making them readable by any OpenAPI tool and portable.

Nunjucks expressions, living inside double braces, are evaluated when the request is sent. While tags solve the problem of needing unique identifiers or current timestamps in every request, they encode dynamic behavior into a string format unique to Insomnia.

Declarative spec values, on the other hand, live in the schema, describing defaults, constraints, and types. This separation of concerns enables portable behavior - the contract declares the field's shape, while code generates the actual value.

For example, an order ID can be a string with a specific format. The contract declares this shape, while a client or test harness provides the actual UUID. This way, generators and test code handle dynamic generation, keeping the contract as the source of truth.

However, it's risky to embed logic in strings as tools can't inspect it. A linter can't check UUID formats, and diffs show string changes rather than logic changes.

Templates shine for quick exploratory work or client-specific conveniences not suited for the contract. But when template tags encode real business logic, moving that logic into code or the contract makes the requests testable and reviewable in CI.

To migrate, ask what each template tag is producing. A UUID maps to a schema format and generator, an environment reference maps to runtime configuration, and chained response values map to generated client flows passing data between calls. Replacing tags with a schema and generator removes client lock-in, making requests runnable in CI without a GUI.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Field sales automation (SFA) app source code with a one-time licence: beat plan, order booking and cash/cheque payment collection (2026)

Yes: you can buy a field sales automation (SFA) app's source code once, with no per-user fee, and still get beat plans, dealer-wise order booking and cash, cheque and bank payment collection.

  • Beatplan SFA app source code available for $2,900 one-time license
  • Features include order booking, cash/cheque payment collection, and offline orders
  • Built with Expo, React Native, and Supabase Postgres for cross-platform compatibility

Meet Ściežka: A Free, Wind-Aware Route Planner and Bike Garage for Riders and Hikers

I built Ściežka (pronounced [ sez-ka ] , from the traditional European word for a winding footpath or hidden forest trail) for cyclists, bikepackers, randonneurs, and hikers who just want a fast…

  • Ścieżka is a free route planner for cyclists, hikers, and bikepackers.
  • Integrates live wind and weather data along routes for better planning.
  • Offers A4 roadbook and cue sheet generator for printed directions.

Transactional Outbox and Inbox in Spring Boot

A polling-based transactional outbox and inbox for Spring Boot, taken apart: how events leave the database, why the polling delay adapts, why each event type gets its own settings, and the three…

  • Transactional Outbox ensures events are part of the same transaction as business data.
  • Outbox includes four background jobs for event processing management.
  • Adaptive polling strategy manages event delivery with minimum 250ms delay.

More from Wednesday 4 November →