question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] 5.0.0 breaks generator if servers url relative

See original GitHub issue

Hi recently switch from openapi-generator-maven-plugin@4.3.1 to 5.0.0 and the generation of my swagger did not work anymore.

After hours of search, I finaly found that it was mu servers > url value that breaked the generation. Of course my swagger is valid according to https://apitools.dev/swagger-parser/online/ (and many others). And also specification : https://swagger.io/specification/#server-object

Field Name Type Description
url string REQUIRED. A URL to the target host. This URL supports Server Variables and MAY be relative

Step to reproduce :

Take the classic petstore : https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml Change

servers:
  - url: http://petstore.swagger.io/v1

To

servers:
  - url: /v1

Run

java -jar openapi-generator-cli.jar generate -i <path_to/petstore.yaml> -g spring

Breaks with error (unclear at all) com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'openapi': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')

I guess it breaks all generator cause it also break validate command.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:9
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
jhannescommented, Apr 19, 2021

I think this is the underlying cause: https://github.com/swagger-api/swagger-parser/issues/1553

3reactions
norrscommented, May 25, 2021

What is the usual timeframe for making a new release of openapi-generator in maven repositories which includes the fix shipped in https://github.com/swagger-api/swagger-parser/issues/1553? Is this considered critical enough to warant a quick release for the team? (cc @wing328 as I see the user in the Github releases page)

As currently this breaks builds for our Windows developers without involving and running the maven target for openapi-generator under WSL2 in Windows after we upgraded from 4.3.1 to 5.1.0.

Thanks @jhannes for finding the underlaying cause and fixing this upstream.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] 5.0.0 breaks generator if servers url relative - - Bountysource
Hi recently switch from openapi-generator-maven-plugin@4.3.1 to 5.0.0 and the generation of my swagger did not work anymore. After hours of search, ...
Read more >
URL handling options | Docs - TinyMCE
Relative URLs. This will convert all URLs within the same domain to relative URLs. The URLs will be relative from the document_base_url. relative_urls ......
Read more >
Bug listing with status CONFIRMED as at 2022/12/07 04:46:31
There is no server at all: it only relies on end-users' machines. ... Bug:102536 - "URLs within description of [url] tags break the...
Read more >
Appweb Change Log - Embedthis
[issue 314]. ESP scripts() and stylesheets() to emit cleaner relative URIs. ... Installation location of esp generator component files [issue 235] ...
Read more >
Fixes integrated in HCL Digital Experience 8.5.0.0, 9.0 and 9.5 ...
HCL Portal Server and HCL Web Content Management problems fixed in Release CF207. Defect # ... DAM PICKER RETURNS RELATIVE URLS IN SOFY...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found