OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.86k stars 6.59k forks source link

[BUG] Unrecognized token 'openapi' on Windows boxes #9678

Open iliuta opened 3 years ago

iliuta commented 3 years ago

Bug Report Checklist

Description

Using openapi generator gradle plugin 5.1.1. Spec is validated by the online tools.

On Mac machines and/orr Docker linux containers, it works perfectly.

On windows machines, I have this:


 ./gradlew build

> Task :openApiValidate FAILED
Validating spec /Users/az02277-dev/builds/shared/api-springboot-java/src/main/resources/openapi/api-v1.0.yaml
failed to read resource listing
com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'openapi': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: (String)"openapi: "3.0.0"

If I use an openapi version which does not exist (3.1.0 for instance) the output is similar, no matter which platform I use.

openapi-generator version

5.x.x versions have the issue 4.3.1 works just fine

OpenAPI declaration file content or url

Tried with several spec files, so I don't think the content is relevant. However, if you can't reproduce it, I could provide the spec.

Generation Details

Openapi generator plugin for gradle with java 11 OpenJdk

Steps to reproduce

On a Windows platform: ./gradlew openApiGenerate

Related issues/PRs
Suggest a fix
julianladisch commented 3 years ago

Duplicate of #8260 Duplicate of #8266