1414 * limitations under the License.
1515 */
1616
17- package com.github.hauner.openapi.spring.generatr
17+ package com.github.hauner.openapi.spring.processor
1818
19- import com.github.hauner.openapi.api.OpenApiGeneratr
19+ import com.github.hauner.openapi.api.OpenApiProcessor
2020import com.github.hauner.openapi.spring.converter.ApiConverter
2121import com.github.hauner.openapi.spring.converter.ApiOptions
2222import com.github.hauner.openapi.spring.writer.ApiWriter
@@ -31,34 +31,34 @@ import io.swagger.v3.parser.core.models.ParseOptions
3131import io.swagger.v3.parser.core.models.SwaggerParseResult
3232
3333/**
34- * Entry point of openapi-generatr -spring.
34+ * Entry point of openapi-processor -spring.
3535 *
3636 * @author Martin Hauner
3737 * @author Bastian Wilhelm
3838 */
39- class SpringGeneratr implements OpenApiGeneratr {
39+ class SpringProcessor implements OpenApiProcessor {
4040
4141 @Override
4242 String getName () {
4343 return ' spring'
4444 }
4545
4646 @Override
47- void run (Map<String , ?> generatrOptions ) {
47+ void run (Map<String , ?> processorOptions ) {
4848 ParseOptions opts = new ParseOptions (
4949 // loads $refs to other files into #/components/schema and replaces the $refs to the
5050 // external files with $refs to #/components/schema.
5151 resolve : true
5252 )
5353
5454 SwaggerParseResult result = new OpenAPIV3Parser ()
55- .readLocation (generatrOptions . apiPath as String , null , opts)
55+ .readLocation (processorOptions . apiPath as String , null , opts)
5656
57- if (generatrOptions . showWarnings) {
57+ if (processorOptions . showWarnings) {
5858 printWarnings(result. messages)
5959 }
6060
61- def options = convertOptions (generatrOptions )
61+ def options = convertOptions (processorOptions )
6262 def cv = new ApiConverter (options)
6363 def api = cv. convert (result. openAPI)
6464
@@ -86,30 +86,30 @@ class SpringGeneratr implements OpenApiGeneratr {
8686 writer. write (api)
8787 }
8888
89- private ApiOptions convertOptions (Map<String , ?> generatrOptions ) {
89+ private ApiOptions convertOptions (Map<String , ?> processorOptions ) {
9090 def reader = new MappingReader ()
9191 def converter = new MappingConverter ()
9292 def mapping
9393
94- if (generatrOptions . containsKey (' mapping' )) {
95- mapping = reader. read (generatrOptions . mapping as String )
94+ if (processorOptions . containsKey (' mapping' )) {
95+ mapping = reader. read (processorOptions . mapping as String )
9696
97- } else if (generatrOptions . containsKey (' typeMappings' )) {
98- mapping = reader. read (generatrOptions . typeMappings as String )
97+ } else if (processorOptions . containsKey (' typeMappings' )) {
98+ mapping = reader. read (processorOptions . typeMappings as String )
9999 println " warning: 'typeMappings' option is deprecated, use 'mapping'!"
100100 }
101101
102102 def options = new ApiOptions ()
103- options. apiPath = generatrOptions . apiPath
104- options. targetDir = generatrOptions . targetDir
103+ options. apiPath = processorOptions . apiPath
104+ options. targetDir = processorOptions . targetDir
105105
106- if (generatrOptions . packageName) {
107- options. packageName = generatrOptions . packageName
106+ if (processorOptions . packageName) {
107+ options. packageName = processorOptions . packageName
108108 println " warning: 'options:package-name' should be set in the mapping yaml!"
109109 }
110110
111- if (generatrOptions . containsKey (' beanValidation' )) {
112- options. beanValidation = generatrOptions . beanValidation
111+ if (processorOptions . containsKey (' beanValidation' )) {
112+ options. beanValidation = processorOptions . beanValidation
113113 println " warning: 'options:bean-validation' should be set in the mapping yaml!"
114114 }
115115
0 commit comments