SShortSingh.
Back to feed

Reject Duplicate JSON Keys Before Validating a Record

0
·13 views

A technical article explains why validating only the dictionary produced by a JSON decoder can miss repeated member names, since the duplicate may vanish during decoding. It recommends inspecting key-value pairs during decoding, using Python's object_pairs_hook to detect repeats at every nesting level. The article presents a teaching parser that enforces a 4,096-byte UTF-8 limit, requires a top-level object, rejects non-finite constants like NaN, and parses decimals as Decimal values. The example code was tested locally on Python 3.12 with six cases, using invented fixtures rather than production data. The author notes that this decoding check is separate from application-level schema and range validation, which should be tested independently.

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 ·

OpenAI doubles ChatGPT Pro usage limits and merges ChatGPT and Codex allowances

OpenAI has confirmed it is doubling usage limits for its Pro plan, according to BleepingComputer. The company is also bringing ChatGPT Work capabilities directly into regular Chat. Usage allowances across ChatGPT and Codex are being combined, though reporting suggests a shared pool but does not confirm how it is calculated. Details such as the baseline limits, which plans beyond Pro are affected, and the rollout timeline were not disclosed in the available coverage. Users are advised to consult OpenAI's official announcement for exact figures and schedules.

0
ProgrammingDEV Community ·

Rotifer v0.9.4 gives AI agents persistent memory across runs

Previously, each run of a Rotifer gene started with no memory of earlier runs. Version 0.9.4 of the protocol lets every agent keep memory that its genes can read and write between runs through four calls. Memory is owned by the agent rather than by individual genes, so replacing or upgrading a gene does not erase what the agent has learned. Entries fall into four categories (PREFERENCE, PATTERN, CONTEXT, CACHE), each with its own eviction behavior, and each agent has a default quota of 10 MB that can be set when it is created. Access rules, optional retention limits, and operator tools for listing and deleting entries govern how the stored memory is used and controlled.

0
ProgrammingDEV Community ·

Google Extends UGC Spam Guidance to Publishing and Sharing Tools

Google has broadened its guidance on user-generated content abuse to cover platforms and apps that let people publish shared pages, generated content, or web apps. The focus is on the indexing and abuse controls of third-party publishing and sharing services, not only traditional forums and comment sections. The guidance, last updated October 26, 2026, recommends that platform owners index only content intended for Search, using noindex meta tags, X-Robots-Tag headers, or robots.txt blocking. It also urges operators to monitor for abuse signals, such as sudden surges in new indexed URLs, and to verify their sites in Search Console.

0
ProgrammingDEV Community ·

Researchers urge Gibbon school software deployments to separate student records from public login pages

A security-focused article argues that Gibbon, an open-source school management platform covering student profiles, attendance, and enrolment, should keep sensitive school data distinct from its publicly visible login or admissions pages. It notes that search-engine queries found 872 hosts matching the application name and 632 matching its title, though a name match alone does not show that records are exposed. The piece emphasizes reviewing permissions for each role such as administrators, teachers, parents, and support staff, especially for impersonation, messaging, and medical or safeguarding fields. It also recommends verifying OAuth2 login behavior, ensuring external identities do not automatically receive administrator rights, and testing session expiry and account deactivation. Its closing guidance is that organizations should confirm host ownership and monitor authentication and permission events rather than act on version-based assumptions.