Generate a Swagger file for certain endpoints from another Swagger or OpenAPI file
问题 Having one big Swagger/OpenAPI YAML specification, how can I safely extract certain API endpoints and generate a new .yaml for them exclusively? It's easy to identify API endpoints from a certain level (like defined with one indent or more): paths: /users: ... - $ref: '#/requests/getUser' /repos: ... requests: getUser: ... I'd just copy all sections, except paths , into a new specs file. And then I'd copy certain paths subsections like /users: based on indents. In Python, with a regex. But is