OpenAPI-Specification icon indicating copy to clipboard operation
OpenAPI-Specification copied to clipboard

openapi batch post or put

Open katty0924 opened this issue 5 years ago • 3 comments

hi, I just wanna know, Are the batch operations such as put, post allowed in the openapi? supposed that, if I put/post some objects in a batch operation, and during the process, some data are failed to put/post in the api, then all the data will be rollback? and if the data are large in the batch operation, that can also be a problem

katty0924 avatar Sep 17 '19 13:09 katty0924

I'm also interested in a similar question - currently looking to migrate from openapi 2 to 3 in nodejs/express.

Is it possible to post an array of objects some of which pass validation and some that don't. Then have the validator return a batch of reject error message for objects that didn't pass while allow the valid objects to pass through to the controller code? I don't want the error objects to prevent processing of the valid objects.

jeffswitzer avatar Oct 08 '19 20:10 jeffswitzer

The OpenAPI Specification doesn't enforce back-end implementation of things like rollback. The HTTP specification requires PUT to be atomic, so PUT operations need to handle that (whether they are described by OpenAPI or not). POST has no such guarantees, and OpenAPI does not impose constraints beyond what HTTP requires.

As for partial validation, you can do that in general, but again it is not someting that OpenAPI is aware of. It describes the HTTP interface, not what happens behind it.

handrews avatar Jan 27 '24 02:01 handrews

This issue has been labeled with No recent activity because there has been no recent activity. It will be closed if no further activity occurs within 28 days. Please re-open this issue or open a new one after this delay if you need to.

github-actions[bot] avatar Feb 04 '24 21:02 github-actions[bot]