Skip to content
Advertisement

Swagger Codegen basePath is being ignored

I’m trying to generate some web services definitions using Swagger Codegen » 2.2.1

All configs are working and the classes are generate correctly by my .yaml definitions.

Why the property basePath is being ignored?


My @RestController generate using only paths definition:

JavaScript

Expected (using basePath and paths definitions):

JavaScript

What am I doing wrong? Did I forget something?


My .yaml contract:

JavaScript

Advertisement

Answer

Searching more about this, I found the issue.

It’s a bug fixed by HugoMario (commit referenced on 2 Dec 2019)

And following Helen suggestion, I update my Swagger Codegen:

  • From » 2.2.1 » old release (Aug 07, 2016)

  • To » 2.4.12 » current stable release (Jan 15, 2020)

Summary: » It’s a bug of an outdated version » Now works fine!


Maven dependecy for swagger-codegen-maven-plugin:

JavaScript

Maven Central Repository (check new releases):


Update Maven Project (Eclipse shortcut F5) and make a clean build:

JavaScript

Reference:

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement