One parameterSchema or one each for URL Parameters, headers and body? #20
Replies: 3 comments 4 replies
-
I think it is desirable to support dependencies between the different types of parameters, so I hope we can keep these all in one schema. Could we use a JSON schema dialect to define our own |
Beta Was this translation helpful? Give feedback.
-
According to our research, dependencies between parameters of different types are extremely rare, but they do happen. Think, for example, an ID path parameter which must coincide with an ID property in the request body when making a PUT request to modify a resource. Therefore, I agree with Mike that we should have just one parameterSchema, if that is the only way to support these types of dependencies. |
Beta Was this translation helpful? Give feedback.
-
You could just model HTTP as an object with three fields: Then you don't have the duplication between different schemas, and you haven't reserved any actual parameter names. Of course, |
Beta Was this translation helpful? Give feedback.
-
If we just have one parameterSchema then we need to reserve the property names "headers" and "body" in the parameterSchema. This could cause problems if someone has an API with those names as url parameters.
The advantage of one parameterSchema is that it would be possible to have dependencies between the URL parameters, and header parameters, and body content. It also makes the specification design simpler and makes request selection simpler.
Beta Was this translation helpful? Give feedback.
All reactions