elements icon indicating copy to clipboard operation
elements copied to clipboard

The 'required' keyword in response objects may not make a lot of sense

Open avin-kavish opened this issue 3 years ago • 0 comments

Context

required-in-response

Current Behavior

I think a required field makes sense in the context of request parameters but in the response body, it might not. In the context of a request, it's intepreted as "I am required to enter these fields". But when it's the response, it can't be phrased in the perspective of a consumer.

Expected Behavior

Indicate fields that may not contain a value without using "required" keyword.

Possible Solution(s)

Stripe API uses the "optional" keyword.

avin-kavish avatar Jun 26 '22 10:06 avin-kavish