OpenAPITools / OpenAPITools/openapi-generator

[BUG] nodejs-express-server generator does not generate models

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

Cannot replicate the nodejs-express-server sample to generate models.

openapi-generator version

7.4.0

OpenAPI declaration file content or url

https://github.com/OpenAPITools/openapi-generator/blob/master/samples/server/petstore/nodejs-express-server/api/openapi.yaml

Generation Details

See below

Steps to reproduce
  1. Clone this repo
  2. Install the CLI tool npm install @openapitools/openapi-generator-cli
  3. Navigate to samples/server/petstore/nodejs-express-server
  4. Generate the code npx openapi-generator-cli generate -g nodejs-express-server -o output -i api/openapi.yaml

Expected Results
A directory output/models will be created matching the contents of https://github.com/OpenAPITools/openapi-generator/tree/master/samples/server/petstore/nodejs-express-server/models

Actual Results
No models directory is created. There are no warnings or errors in the log to indicate the models will not be generated.

Related issues/PRs

There was an issue created and then closed here: https://github.com/OpenAPITools/openapi-generator/issues/12274 but details were not included for their work around.

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 samples/server/petstore/nodejs-express-server/api/openapi.yaml and run the documented npx openapi-generator-cli command for the nodejs-express-server generator. Compare the generated output with samples/server/petstore/nodejs-express-server/models; done means output/models is created with the expected model files and no warnings or errors are needed to explain the omission.

Written by the indexing model from the issue text.

Assessment

Tech stack
express, java, nodejs, openapi
Domain
api, backend, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.