Alexander Rezvanov
Alexander Rezvanov

Reputation: 27

How to indicate in OpenAPI that all response fields are required?

I have an answer with 40 fields. I need to specify that all fields are required.

  1. Option to list all fields

    • required: [field1,field2,field3 ..... field40]

Maybe there is an option to indicate that ALL fields of the answer are required. For example allOf ?

Upvotes: 2

Views: 1795

Answers (1)

Helen
Helen

Reputation: 98102

required: [field1, field2, ..., field40] is the only way. There are no shortcuts.

Upvotes: 3

Related Questions