OpenAPITools / OpenAPITools/openapi-generator

[BUG] can't find schema no matter how I write the (valid) filename

Open
#19,432 0 comments 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

When I try to use openapi-generator-cli to generate a schema, it always gives me the "The spec file is not found" error, even though the filename I pass in is valid.

openapi-generator version

openapi-generator-cli 7.8.0
commit : 6bdc452
built : -999999999-01-01T00:00:00+18:00
source : https://github.com/openapitools/openapi-generator
docs : https://openapi-generator.tech/

OpenAPI declaration file content or url

This happens with any spec I try to use. I've tried with both the stripe as well as one produced by Kanidm.

Generation Details

I get this error even with a simple generator request like openapi-generatorcli generate -g cpp-restsdk -o stripe-cpp -i spec3.json (for stripe).

Steps to reproduce
  1. Install openapi-generator-cli with scoop
  2. Try generating any OpenAPI client implementation from a spec and you should get the error. Also, validation doesn't work either; the system assumes that the spec is a JAR or should be on the classpath or something.
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 by reproducing the command shown with openapi-generator-cli 7.8.0 and the referenced Stripe or Kanidm specification. Check the generate and validation entry points for how the input filename is resolved. Done means a valid local OpenAPI file is found and accepted instead of reported as missing.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.