# The request body needs to be of type object, but we found invalid JSON

**URL:** <https://community.postman.com/t/the-request-body-needs-to-be-of-type-object-but-we-found-invalid-json/22644>\
**Category:** Help Hub\
**Tags:** collections\
**Created:** [April 14, 2021, 6:02pm UTC](https://community.postman.com/t/the-request-body-needs-to-be-of-type-object-but-we-found-invalid-json/22644 "2021-04-14T18:02:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wchua-alayacare](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@wchua-alayacare](https://community.postman.com/u/wchua-alayacare)\
**Post date:** [April 14, 2021, 6:02pm UTC](https://community.postman.com/t/the-request-body-needs-to-be-of-type-object-but-we-found-invalid-json/22644/1 "2021-04-14T18:02:43Z")

</div>

Hi,  
I have this sample API definition below:  
\> /schedules/v1/Available:

> ```
> post:
> tags:
> - Available
> security:
> - ApiToken: []
> description: |
> Update available record
> requestBody:
> content:
> application/json:
> schema:
> $ref: '#/components/schemas/Available'
> text/json:
> schema:
> $ref: '#/components/schemas/Available'
> application/xml:
> schema:
> $ref: '#/components/schemas/Available'
> text/xml:
> schema:
> $ref: '#/components/schemas/Available'
> required: true
> ...
> 
> ```

and the following schemas:  
\> schemas:

> ```
> Available:
> type: object
> properties:
> ID:
> type: string
> nullable: true
> description: ID of user
> department:
> type: string
> nullable: true
> description: Department Name
> date:
> type: string
> nullable: true
> description: Available Date
> isavailable:
> type: string
> nullable: true
> description: |
> Indicates whether available. Valid values are **Yes** and **No**
> 
> ```

My content-type is application/xml and in my body, I pass an xml data. When I make a post, I get a schema validation error of “The request body needs to be of type object, but we found invalid JSON”. Is XML as content-type not supported?

 ![postmanAPI.error](https://us1.discourse-cdn.com/getpostman/original/3X/7/0/70927de89a6b7af65fa201d5836a9a2f8b9b5fac.png)

---

<div class="post-metadata">

**Author:** ![vdespa](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/vdespa/32/2770_2.png) [@vdespa](https://community.postman.com/u/vdespa)\
**Post date:** [April 16, 2021, 4:07pm UTC](https://community.postman.com/t/the-request-body-needs-to-be-of-type-object-but-we-found-invalid-json/22644/2 "2021-04-16T16:07:31Z")

</div>

OAS3 does have support for XML. I guess internally Postman is only expecting JSON.
