-
Hi, we have been using required keyword both for request and response objects. Our idea was to show which fields in the response that will always be there, and which might be there. Now there is debate if that is correct, as some say required keyword should only be used for requests. so for starters, is that correct, that it shouldn’t be used for responses? If so, how should fields that will always be in response and those that might be there be differentiated? also, if anyone could post some links to some info about the subject that would be great. cheers! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@Zahak If you mean a
If you mean individual fields, |
Beta Was this translation helpful? Give feedback.
-
Answer accepted, closing. |
Beta Was this translation helpful? Give feedback.
Yes, you would put
phone_number
(or however you spell the field) in the schema'srequired
keyword, but leave thework_number
field out. Which is exactly what you would do for requests. The Schema Object doesn't "know" whether it's a request or response or parameter or header or whatever - it's just a structural description.