swagger-api / swagger-api/swagger-codegen-generators

[jaxrs-cxf] Guaranteed MalformedURLException

Open
#138 1 comment 0 reactions 1 assignee View on GitHub

@HugoMario is already working on this.

Since Aug 8, 2018.

Dominant language
Mustache
Stars
299
Forks
439
PR merge metrics
No merged PRs in 30d

Description

AbstractJavaJAXRSServerCodegen always logs a needless warning-level MalformedURLException for a valid OAS 2.0 YAML, because according to the OAS 2.0 specification for basePath: "The value MUST start with a leading slash (/)", which can never be a valid URL and will thus always throw MalformedURLException.

[WARNING] Not valid URL: /v1/dt
java.net.MalformedURLException: no protocol: /v1/dt
at java.net.URL.(URL.java:593)
at java.net.URL.(URL.java:490)
at java.net.URL.(URL.java:439)
at io.swagger.codegen.utils.URLPathUtil.getServerURL(URLPathUtil.java:30)
at io.swagger.codegen.languages.java.AbstractJavaJAXRSServerCodegen.preprocessOpenAPI(AbstractJavaJAXRSServerCodegen.java:92)
at io.swagger.codegen.DefaultGenerator.configureGeneratorProperties(DefaultGenerator.java:201)
at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:722)
at io.swagger.codegen.plugin.CodeGenMojo.execute(CodeGenMojo.java:534)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.