Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #14971
Closed
Open
Issue created Mar 15, 2023 by Guillaume Turri@gturriContributor5 of 6 checklist items completed5/6 checklist items

[BUG][typescript-angular] generated README has invalid instructions

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 generate a client with the typescript-angular generator, the generated code has a README.md which starts with

To install the required dependencies and to build the typescript sources run:

  npm install
  npm run build

However running npm install fails with no such file or directory, open '/path/to/generated/directory/package.json'

Indeed, the generated code does not have a package.json (not sure if the issue is that the generated code should have a package.json or if the README should have other instructions)

openapi-generator version

Observed with 6.3.0 and reproduced with a jar built with the latest master

OpenAPI declaration file content or url

I think the content of the openapi file does not matter. However, here is a simple one with which I observe that issue:

openapi: 3.0.1
info:
  title: Test
  version: 0.0.1
paths:
  /my-route:
    get:
      summary: Get stuff
      parameters:
        - name: myparam
          in: query
          required: false
          schema:
            type: string
            format: date-time
      responses:
        "200":
          description: OK
Generation Details

generate with

java -jar openapi-generator-cli.jar generate -g typescript-angular -i openapi.yaml -o out
Steps to reproduce

after generating the typescript-angular code with the above command:

cd out                     # go to the generated directory
head README.md # look at the first instructions of the README
npm install              # run the first command found in the README

expected behavior: the command succeeds observed behavior: the command complains that it is looking for an unexpected package.json

(nb: I observe that issue with npm 9.5.0 on Ubuntu)

Related issues/PRs

I haven't found any related issues on https://github.com/OpenAPITools/openapi-generator/issues?q=is%3Aissue+is%3Aopen+angular+README

Suggest a fix

I guess a package.json should be generated (or the README should be updated)

Assignee
Assign to
Time tracking