OpenAPITools / OpenAPITools/openapi-generator

[BUG] Unrecognized token 'openapi' on Windows boxes

Open
#9,678 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Bug Report Checklist
  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • [] Have you searched for related issues/PRs?
  • [] What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
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

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.

Research direction

Start with the Gradle plugin's openApiValidate and openApiGenerate tasks, reproducing the failure on Windows with openapi-generator 5.x and Java 11. Compare the behavior with version 4.3.1 and the reported Mac or Docker results; done means a valid OpenAPI YAML file is accepted consistently across platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api, build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.