# Array in requestBody duplicates array indexes

**URL:** <https://community.postman.com/t/array-in-requestbody-duplicates-array-indexes/51019>\
**Category:** Help Hub\
**Tags:** array, openapi, request-body\
**Created:** [August 27, 2023, 2:25pm UTC](https://community.postman.com/t/array-in-requestbody-duplicates-array-indexes/51019 "2023-08-27T14:25:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rjs](https://avatars.discourse-cdn.com/v4/letter/r/ea5d25/32.png) [@rjs](https://community.postman.com/u/rjs)\
**Post date:** [August 27, 2023, 2:25pm UTC](https://community.postman.com/t/array-in-requestbody-duplicates-array-indexes/51019/1 "2023-08-27T14:25:54Z")

</div>

Hi all,

After creating a new API in PM (see JSON code) and Add Collection → Generate from definition the requestBody duplicates the `proparray` indexes and `deleted` array is not printed.  
When importing same file to Swagger of Insomnia it produces the correct array.  
See screenshots below.  
Please help.

```auto
{
  "openapi": "3.0.0",
  "info": {
    "version": "1.0.0",
    "title": "Sample API",
    "description": "Example of API"
  },
  "servers": [
    {
      "url": "exampleapi.com/"
    }
  ],
  "paths": {
    "/exampleapi/": {
      "parameters": [
        {
          "name": "userId",
          "in": "query",
          "required": false,
          "schema": {
            "type": "string",
            "example": "John Doe"
          }
        }
      ],
      "put": {
        "tags": [
          "testapi"
        ],
        "summary": "testing the api",
        "requestBody": {
          "description": "testing the api",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/reqbody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "reqbody": {
        "type": "object",
        "properties": {
          "prop1": {
            "type": "string",
            "example": "prop1value"
          },
          "prop2": {
            "type": "string",
            "example": ""
          },
          "proparray": {
            "type": "array",
            "items": {
              "properties": {
                "proparray1": {
                  "type": "string",
                  "example": "proparray1value"
                },
                "proparray2": {
                  "type": "string",
                  "example": "proparray2value"
                },
                "proparray3": {
                  "type": "string",
                  "example": ""
                }
              }
            }
          },
          "deleted": {
            "type": "array",
            "items": {
              "properties": {}
            }
          },
          "mark": {
            "type": "string",
            "example": ""
          }
        }
      },
      "ApiResponse": {
        "type": "object",
        "properties": {
          "succes": {
            "type": "string",
            "example": "true"
          },
          "errorCode": {
            "type": "string",
            "example": "200"
          },
          "errorMessage": {
            "type": "string",
            "example": "OK"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "description": "A human readable error message",
            "type": "string"
          }
        }
      }
    }
  }
}

```

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/c/c/cc975873282996669350977d8784a6a2ea0f8a79.png)  
 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/8/e/8e24b0a3f1c436dece06a004176cf2414588f128.png)  
 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/d/7/d73ada33e35b6dd6b473a35948b6fc4442ca47e2.png)

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [November 25, 2023, 2:26pm UTC](https://community.postman.com/t/array-in-requestbody-duplicates-array-indexes/51019/2 "2023-11-25T14:26:05Z")

</div>

Closed on November 25, 2023, 2:26pm UTC

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