Closed EdHowe closed 3 years ago
Could you please add more info
A sample example files showing
The unmerged files and final merged files.
When the plugin performs the merge, it basically throws out the 'info' block from each of the specs being merged, and replaces them with one specified in the openApiMerge extension's openApi { info { ... } } block. I'd like to be able to do the same for the servers block.
So, given a.yaml:
openapi: 3.0.1
info:
title: API A
version: 1.0.0
servers:
- url: "http://a.example.com"
paths: ...
and b.yaml:
openapi: 3.0.1
info:
title: API B
version: 1.0.0
servers:
- url: "http://b.example.com"
paths: ...
and perhaps something in my build.gradle that looks like the following:
openApiMerger {
inputDirectory = new File("${buildDir}/api-specs")
output {
directory = new File("${buildDir}/openapi")
fileName = 'openapi3'
fileExtension = 'yaml'
}
openApi {
openApiVersion = "3.0.1"
info {
title = "My API"
version = "1.0.0"
}
servers [ "http://some.other.host.com" ]
}
}
Then I would have ${buildDir}/openapi/openapi3.yaml containing:
openapi: 3.0.1
info:
title: API B
version: 1.0.0
servers:
- url: "http://some.other.host.com"
paths: ...
@EdHowe
Very sorry for a delayed response.
I will try and provide an implementation within end of this week.
Thank you Regards Ramesh
Hi
This feature should be avilable in the newer version.
Can you please check and provide feedback?
Regards Ramesh
Implemented in 1.0.4
It would be useful to be able to override the 'servers' block during merge.