# Duplicate keys in JSON response

**URL:** <https://forum.codecrafters.io/t/duplicate-keys-in-json-response/16221>\
**Category:** Challenges\
**Tags:** challenge:claude-code\
**Created:** [July 30, 2026, 6:52am UTC](https://forum.codecrafters.io/t/duplicate-keys-in-json-response/16221 "2026-07-30T06:52:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aniruddhaniranjan](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/aniruddhaniranjan/32/27683_2.png) [@aniruddhaniranjan](https://forum.codecrafters.io/u/aniruddhaniranjan)\
**Post date:** [July 30, 2026, 6:52am UTC](https://forum.codecrafters.io/t/duplicate-keys-in-json-response/16221/1 "2026-07-30T06:52:03Z")

</div>

Hi, while implementing/testing the write tool, sometimes I’m getting a response from the OpenAI client with duplicate keys in the JSON. Please see below where function arguments have two keys “parameter”

[your\_program] Usage of toolCall : ChatCompletionMessageToolCall{id=toolu\_bdrk\_014bUpP2ePKMmpCAK2xnFVfS, function=Function{arguments={“parameter”: “app/main.py”, “parameter”: “print(“Hello world”)”}, name=Write, additionalProperties={}}, type=function, additionalProperties={index=0}}

---

<div class="post-metadata">

**Author:** ![aniruddhaniranjan](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/aniruddhaniranjan/32/27683_2.png) [@aniruddhaniranjan](https://forum.codecrafters.io/u/aniruddhaniranjan)\
**Post date:** [July 30, 2026, 10:01am UTC](https://forum.codecrafters.io/t/duplicate-keys-in-json-response/16221/3 "2026-07-30T10:01:48Z")

</div>

Also the schema of the parameters json in the response is changing across different calls

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [July 31, 2026, 12:05am UTC](https://forum.codecrafters.io/t/duplicate-keys-in-json-response/16221/5 "2026-07-31T00:05:33Z")

</div>

Hey @aniruddhaniranjan, you’re right that a function call with two `"parameters"` keys isn’t valid.

One issue is that the type fields should be lowercase `"object"` (per the JSON Schema specification), not `"Object"`.

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/0/3/03d97b27b54b97dde48adf4fd7468cab17fde87e.png)

And the resulting function call should look like this:

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/9/1/917cabf5b4e088a5efff678c3fe1e3b7d5d9ea36.jpeg)

Let me know if you need any further help.

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [August 10, 2026, 12:02am UTC](https://forum.codecrafters.io/t/duplicate-keys-in-json-response/16221/7 "2026-08-10T00:02:35Z")

</div>

Closing this thread due to inactivity. If you still need assistance, feel free to reopen or start a new discussion!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [August 15, 2026, 12:02am UTC](https://forum.codecrafters.io/t/duplicate-keys-in-json-response/16221/8 "2026-08-15T00:02:40Z")

</div>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
