You are using Swagger Codegen 2.x which does not support OpenAPI 3.0.
You need to use Swagger Codegen 3.x instead. You can download the latest 3.x CLI JAR from Maven Central:
https://mvnrepository.com/artifact/io.swagger.codegen.v3/swagger-codegen-cli
Here’s a direct link to v. 3.0.20 CLI (the latest version as of the time of writing):
https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.20/swagger-codegen-cli-3.0.20.jar
Or if you prefer to build the codegen from the source code, version 3 is in the 3.0.0
branch:
https://github.com/swagger-api/swagger-codegen/tree/3.0.0