kpramesh2212 / openapi-merger-plugin

A plugin to merge openapi v3 files
Apache License 2.0
20 stars 8 forks source link

Keep servers field in only one YAML add extra URL #10

Closed ReginaldoSantos closed 3 years ago

ReginaldoSantos commented 3 years ago

Plugin version: 1.0.3 (also happens with 1.0.4)

./gradlew --version

------------------------------------------------------------
Gradle 6.6.1
------------------------------------------------------------

Build time:   2020-08-25 16:29:12 UTC
Revision:     f2d1fb54a951d8b11d25748e4711bec8d128d7e3

Kotlin:       1.3.72
Groovy:       2.5.12
Ant:          Apache Ant(TM) version 1.10.8 compiled on May 10 2020
JVM:          11.0.11 (Ubuntu 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OS:           Linux 5.8.0-59-generic amd64

If 'servers' field is available only in one of the merged yamls:

servers:
  - url: 'http://localhost:8080/test-api'
    description: default Server

The result is a YAML with an extra 'url' field for 'servers':

servers:
  - url: /
  - url: 'http://localhost:8080/test-api'
    description: default Server
ReginaldoSantos commented 3 years ago

Actually, on version 1.0.4, if we add ServersExtension like below:

           servers {
               register("default") {
                   url.set("http://localhost:8080/test-api")
                   description.set("default Server")
               }
           }

The problem is mitigated. I can live with that ;-)