Marking requestBody as required (or make it available for the user)

It would be good to put a required: true to each requestBody section in the yaml file or make this option avaiable in the ui (right now the setting is actively disabled).

More accurat definition of PUST/POST methods and their bodies.
We’re using open api code generators with the generated yaml files and they are using this specific parameter. Depending on it they are generating different code.

Personally, in our API, all bodies are required. So for met it would be fine to put a fixed required: true, but maybe there are of course other use cases.

I’m hoping someone from the stoplight team can speak to this one. It doesn’t seem that Stoplight studio offers a way to mark the response body as required. This is surprising since I would think this is the more common scenario - if a response body is defined, it’s usually not optional.

Having to manually add the required flag to all our routes is a huge pain. The best option we have right now is to make a spectral rule to require this flag.

@vncz - Is this the appropriate place for this, or should this be a feature request somewhere? Tagging you since you’re usually pretty responsive :wink:

Hey, @tylerscottnielsen

I’m kinda surprised we do not offer such option (I have just verified it). Let me ask internally, maybe there’s a reason we haven’t properly documented yet. Stay tuned.

@tylerscottnielsen Getting back about this — unfortunately we do not have this feature yet.

We would really like this feature also. As suggested by @jeremias.isnardy a fixed required: true for all paths that specify a body is also fine.