# How to mark additional properties as required field in open api 3

**URL:** <https://community.smartbear.com/t/how-to-mark-additional-properties-as-required-field-in-open-api-3/187>\
**Category:** Swagger OS\
**Tags:** api, migrated, swagger-oss\
**Created:** [August 11, 2021, 6:19am UTC](https://community.smartbear.com/t/how-to-mark-additional-properties-as-required-field-in-open-api-3/187 "2021-08-11T06:19:48Z")\
**Posts on this page:** 2\
**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:** [August 11, 2021, 6:19am UTC](https://community.smartbear.com/t/how-to-mark-additional-properties-as-required-field-in-open-api-3/187/1 "2021-08-11T06:19:48Z")

</div>

> Originally posted by **snehakarnam** on August 10, 2021

Hi ,

I have a reference schema which has additional properties properties defined as fallows,

_ **testDto:** _  
_ **type: object** _  
_ **additionalProperties:** _  
_ **type: string** _  
_ **example:** _  
_ **name: Note** _  
_ **Threads: 5** _

how can i mark additionalProperties as a required field in openapi 3?

---

<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:** [August 11, 2021, 5:01pm UTC](https://community.smartbear.com/t/how-to-mark-additional-properties-as-required-field-in-open-api-3/187/2 "2021-08-11T17:01:28Z")

</div>

> Originally posted by **HKosova** on August 11, 2021

If you mean that the object must have at least N properties, use _minProperties_:

```auto
testDto:
  type: object
  additionalProperties:
    type: string
  minProperties: 1 # <----------
  example:
    name: Note
    Threads: '5'

```

The “required” list is only used to require _specific named properties_. For example, the following means that the object must have properties named “name” and “Threads” with any values and may have arbitrary extra properties.

```auto
testDto:
  type: object
  required:
    - name
    - Threads
  additionalProperties:
    type: string

```

This is equivalent to:

```auto
testDto:
  type: object
  required:
    - name
    - Threads
  properties:
    name: {} # any type
    Threads: {} # any type
  additionalProperties:
    type: string

```
