# OAS 3.0.3 request schema for an empty JSON body

**URL:** <https://community.smartbear.com/t/oas-3-0-3-request-schema-for-an-empty-json-body/240>\
**Category:** Swagger OS\
**Tags:** api, migrated, swagger-oss, swagger-core, json, oas, schema\
**Created:** [January 24, 2021, 2:17am UTC](https://community.smartbear.com/t/oas-3-0-3-request-schema-for-an-empty-json-body/240 "2021-01-24T02:17:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 24, 2021, 2:17am UTC](https://community.smartbear.com/t/oas-3-0-3-request-schema-for-an-empty-json-body/240/1 "2021-01-24T02:17:13Z")

</div>

> Originally posted by **MythosAPI** on January 23, 2021

I am attempting to create an OAS schema for an empty JSON body:

```auto
{ }

```

I am trying to get the documentation to show an empty JSON body, and have that autogenerated.

The API defines this as a POST (yes, it ought to be a GET, the design of the API is in some respects sub-optimal) request, and expects the open/close bracket, and nothing else. I’ve tried

```auto
  …
  content:
    application/json: { }
  …

```

but that doesn’t work (it just shows nothing in the request body), and everything else I’ve tried is invalid. Would appreciate any assistance on this. I have not been able to find any examples or even similar questions (maybe I’m looking in the wrong place?).

Any assistance would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 24, 2021, 8:30pm UTC](https://community.smartbear.com/t/oas-3-0-3-request-schema-for-an-empty-json-body/240/2 "2021-01-24T20:30:59Z")

</div>

> Originally posted by **MythosAPI** on January 24, 2021

Solved.

```auto
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmptyBody'

# # # # # # 

     EmptyBody:
          type: object
          nullable: true

```

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [November 20, 2021, 6:26pm UTC](https://community.smartbear.com/t/oas-3-0-3-request-schema-for-an-empty-json-body/240/3 "2021-11-20T18:26:09Z")

</div>

> Originally posted by **Devil** on November 20, 2021

How can I give empty JSON as an “example” at components/schemas of swagger JSON?

I tried this

```auto
"components": { "schemas": { "APIname":{ "type": "object", "properties": {}, "example": {} }}

```

But this example is not executed when I use schemathesis to run test cases.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [October 7, 2026, 5:13pm UTC](https://community.smartbear.com/t/oas-3-0-3-request-schema-for-an-empty-json-body/240/4 "2026-10-07T17:13:45Z")

</div>

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