Skip to content

Commit

Permalink
fix property name (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
hauner committed Oct 2, 2024
1 parent d0d2b2c commit 94ac14c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class OptionsConverter(private val checkObsoleteProcessorOptions: Boolean = fals
val (enablePathPrefix, pathPrefixServerIndex) = checkServerUrl(mapping.options)
options.basePathOptions.enabled = enablePathPrefix
options.basePathOptions.serverUrl = pathPrefixServerIndex
options.basePathOptions.propertiesName = mapping.options.basePath.profileName
options.basePathOptions.propertiesName = mapping.options.basePath.propertiesName
// to write the base path resource we need standard layout
if (options.basePathOptions.enabled && !options.targetDirOptions.standardLayout) {
log.warn("base-path is enabled, forcing target-dir.layout = standard")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ data class BasePath(
/**
* profile name for base path.
*/
val profileName: String = "api.properties"
val propertiesName: String = "api.properties"
)
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class OptionsConverterSpec: StringSpec({
format-code: false
base-path:
server-url: 0
profile-name: openapi.properties
properties-name: openapi.properties
compatibility:
bean-validation-valid-on-reactive: false
identifier-word-break-from-digit-to-letter: false
Expand Down Expand Up @@ -200,7 +200,7 @@ class OptionsConverterSpec: StringSpec({
package-name: no.warning
base-path:
server-url: ${su.source}
profile-name: openapi.properties
properties-name: openapi.properties
""".trimIndent()
))

Expand All @@ -221,7 +221,7 @@ class OptionsConverterSpec: StringSpec({
package-name: pkg
base-path:
server-url: true
profile-name: openapi.properties
properties-name: openapi.properties
""".trimIndent()
))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,13 @@ class MappingReaderSpec: StringSpec ({
| package-name: no.warning
| base-path:
| server-url: $server
| profile-name: base-path.properties
| properties-name: base-path.properties
""".trimMargin()

val mapping = MappingReader().read(yaml) as Mapping

mapping.options.basePath.serverUrl shouldBe "$server"
mapping.options.basePath.profileName shouldBe "base-path.properties"
mapping.options.basePath.propertiesName shouldBe "base-path.properties"
}
}
})
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ options:
layout: standard
base-path:
server-url: 0
profile-name: api.properties
properties-name: api.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,10 @@ info:
version: 1.0.0

servers:
- url: "{schema}://{host}:{port}/{path1}/{path2}/v{version}"
- url: "https://openapprocessor.io/{path}"
variables:
schema:
default: https
enum:
- https
- http
host:
default: openapiprocessor.io
port:
default: "443"
path1:
default: foo
path2:
default: bar
version:
default: "1"
path:
default: api

paths:
/foo:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,10 @@ info:
version: 1.0.0

servers:
- url: "{schema}://{host}:{port}/{path1}/{path2}/v{version}"
- url: "https://openapprocessor.io/{path}"
variables:
schema:
default: https
enum:
- https
- http
host:
default: openapiprocessor.io
port:
default: "443"
path1:
default: foo
path2:
default: bar
version:
default: "1"
path:
default: api

paths:
/foo:
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
openapi.base.path = /foo/bar/v1
openapi.base.path = /api

0 comments on commit 94ac14c

Please sign in to comment.