Can we set global “consumes” and “produces” in Swagger?
问题 In the each path I need to set consumes and produces . Can I set them globally? post: summary: "" description: "" consumes: - "application/json" - "application/xml" produces: - "application/xml" - "application/json" 回答1: Sure. You can specify consumes and produces on the root level of the spec, and they will be inherited by all operations. Global consumes and produces can be overridden on the operation level if needed. consumes: - application/json - application/xml produces: - application/xml