Skip to content

Commit a8c3ca4

Browse files
committed
read mapping yaml with new code
1 parent e036f13 commit a8c3ca4

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

‎src/main/groovy/com/github/hauner/openapi/spring/generatr/SpringGeneratr.groovy‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 the original authors
2+
* Copyright 2019-2020 the original authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -74,11 +74,16 @@ class SpringGeneratr implements OpenApiGeneratr {
7474

7575
private ApiOptions convertOptions (Map<String, ?> generatrOptions) {
7676
def options = new ApiOptions()
77-
def reader = new TypeMappingReader ()
7877
options.apiPath = generatrOptions.apiPath
7978
options.targetDir = generatrOptions.targetDir
8079
options.packageName = generatrOptions.packageName
81-
options.typeMappings = reader.read (generatrOptions.typeMappings as String)
80+
81+
def reader = new MappingReader ()
82+
def converter = new MappingConverter()
83+
def mapping = reader.read (generatrOptions.typeMappings as String)
84+
if (mapping) {
85+
options.typeMappings = converter.convert (mapping)
86+
}
8287
options
8388
}
8489

0 commit comments

Comments
 (0)