Handle merging different base paths
grokify opened this issue · 1 comments
grokify commented
Overview
Currently, merging expects the same base path / root server URL, however, sometimes the specs to be merged can have different base paths.
Requirements
Description: enhance merging to handle merging different base paths.
- Create absolute paths using OpenAPI3 server urls. Optionally error out if base path is different aside from host name.
- Build all paths with absolute path. Optionally scan all paths an extract either hard coded root, or implicit base path on similarity.
- The priority is for OpenAPI3 but will look to make the code generic so it can be added to OpenAPI2 if needed.
grokify commented
This is now accomplished by modify.SpecPathsModify
and modify.SpecMoreModifyMulti
.
Modify the paths in individual specs first and then merge.
SpecPathsModify
: https://github.com/grokify/swaggman/blob/master/openapi3/modify/paths.goSpecMoreModifyMulti
: https://github.com/grokify/swaggman/blob/master/openapi3/modify/multi.go