Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Accept valid bare JSON in structured response recipes

Closed
#971 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@lipikaramaswamy is already working on this.

Since Sep 30, 2026.

  • #972 by @lipikaramaswamy — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Start with packages/data-designer-engine/src/data_designer/engine/models/recipes/response_recipes.py and trace LLMResponseParser through packages/data-designer-engine/src/data_designer/engine/models/parsers/postprocessors.py, especially merge_text_blocks and deserialize_json_code. Run the reproduction in the issue for both recipes. Done means valid bare JSON is accepted and schema-validated as a fallback, while fenced JSON and invalid or prose-embedded responses retain their existing behavior.

Written by the indexing model from the issue text.

Description

bug
Priority Level

Medium (Annoying but has workaround)

Describe the bug

While using Data Designer 0.9.1 for structured-output columns in NeMo Anonymizer, we encountered model responses containing valid bare JSON that were rejected because they were not wrapped in a Markdown json code fence. Wrapping the same response in a fence made it parse successfully.

This is reproducible with both PydanticResponseRecipe and StructuredResponseRecipe, without making any model calls. A formatting-only difference can therefore cause a valid structured response to fail parsing.

Steps/Code to reproduce bug

With data-designer==0.9.1 installed:

from pydantic import BaseModel

from data_designer.engine.models.recipes.response_recipes import (
    PydanticResponseRecipe,
    StructuredResponseRecipe,
)


class Result(BaseModel):
    answer: int


raw = '{"answer": 42}'
recipes = (
    PydanticResponseRecipe(data_type=Result),
    StructuredResponseRecipe(json_schema=Result.model_json_schema()),
)

for recipe in recipes:
    for label, response in (
        ("bare", raw),
        ("fenced", f"```json\n{raw}\n```"),
    ):
        try:
            print(type(recipe).__name__, label, "OK", recipe.parse(response))
        except Exception as exc:
            print(type(recipe).__name__, label, type(exc).__name__, str(exc))

Actual output:

PydanticResponseRecipe bare ParserException No parsable JSON structure within ```json markdown fence.
PydanticResponseRecipe fenced OK answer=42
StructuredResponseRecipe bare ParserException No parsable JSON structure within ```json markdown fence.
StructuredResponseRecipe fenced OK {'answer': 42}
Expected behavior

Both recipes should accept a response consisting entirely of valid bare JSON as a fallback when fenced JSON parsing finds no usable JSON block. The parsed value must still pass the recipe's existing schema validation.

Existing fenced JSON behavior should continue to work. This request does not require extracting JSON embedded in arbitrary prose or accepting schema-invalid responses.

Agent Diagnostic / Prior Investigation
  • An agent ran the reproduction above against data-designer-engine==0.9.1 and confirmed the output for both recipes.
  • Inspected the tagged v0.9.3 source and the local main checkout at d2470a43dcaf8c5d3babbc0fd2f8631139d40509; both recipes retain the fenced-block parsing path.
  • In packages/data-designer-engine/src/data_designer/engine/models/recipes/response_recipes.py, both recipes use LLMResponseParser with merge_text_blocks and deserialize_json_code, then select a StructuredDataBlock before schema validation.
  • In packages/data-designer-engine/src/data_designer/engine/models/parsers/postprocessors.py, deserialize_json_code processes only CodeBlock objects whose language is json. Bare JSON remains a text block, leaving no structured block for the recipe to validate.
  • Searched the current documentation and GitHub issues/PRs for bare JSON and code-fence parsing; no matching issue or documented bare-JSON fallback was found.
Additional context

We will implement the fallback and contribute a PR with regression tests for both recipes.

Checklist
  • I reproduced this issue or provided a minimal example
  • I searched the docs/issues myself, or had my agent do so
  • If I used an agent, I included its diagnostics above
Dominant language
Python
Stars
2.3k
Forks
219
Avg merge
1d 16h
Merged PRs (30d)
42

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NVIDIA-NeMo/DataDesigner

All issues in NVIDIA-NeMo/DataDesigner

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.