Skip to content

Conversation

ericcrosson-bitgo
Copy link
Contributor

This commit removes the code to calculate a relative path between the
directory containing the tsconfig.json file and the input file. This
permits a copy of @api-ts/openapi-generator installed in one location
to use files from a project in a different location as inputs without
crashing.

Full bug report below.

What I did

$ npx openapi-generator \
  --input ../lib/grooble/src/index.ts \
  --output api.json \
  --tsconfig ../lib/grooble/tsconfig.json \
  --name "Grooble"

What I Expected to Happen

I expected the openapi-generator to create a file named api.json
with the OpenAPI spec described by ../lib/grooble/src/index.ts.

What Actually Happens

Error processing project: src/index.ts not in project

with a non-zero exit code.

What Actually Happens (with These Changes)

The openapi-generator successfully creates a file named api.json
with the OpenAPI spec described by ../lib/grooble/src/index.ts.

However, I'm not sure why this code was added in the first place!
So please review thorougly to see if this will regresss some use-cases
not captured by the tests.

Ticket: BG-41531

This commit removes the code to calculate a relative path between the
directory containing the tsconfig.json file and the input file. This
permits a copy of @api-ts/openapi-generator installed in one location
to use files from a project in a different location as inputs without
crashing.

Full bug report below.

What I did
----------

```
$ npx openapi-generator \
  --input ../lib/grooble/src/index.ts \
  --output api.json \
  --tsconfig ../lib/grooble/tsconfig.json \
  --name "Grooble"
```

What I Expected to Happen
-------------------------

I expected the openapi-generator to create a file named `api.json`
with the OpenAPI spec described by `../lib/grooble/src/index.ts`.

What Actually Happens
---------------------

```
Error processing project: src/index.ts not in project
```

with a non-zero exit code.

What Actually Happens (with These Changes)
------------------------------------------

The openapi-generator successfully creates a file named `api.json`
with the OpenAPI spec described by `../lib/grooble/src/index.ts`.

However, I'm not sure why this code was added in the  first place!
So please review thorougly to see if this will regresss some use-cases
not captured by the tests.

Ticket: BG-41531
@ericcrosson-bitgo ericcrosson-bitgo requested a review from a team June 4, 2022 01:03
@bitgopatmcl
Copy link
Contributor

However, I'm not sure why this code was added in the first place!

Now trying to remember this as well

Copy link
Contributor

@bitgopatmcl bitgopatmcl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might lead to weird effects when mixing one project's source with another's config/modules, but let's see.

@bitgopatmcl bitgopatmcl merged commit f4d095a into BitGo:beta Jun 6, 2022
@github-actions
Copy link

github-actions bot commented Jun 6, 2022

🎉 This PR is included in version 0.2.0-beta.2 🎉

The release is available on npm package (@beta dist-tag)

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 1.0.0-beta.13 🎉

The release is available on npm package (@beta dist-tag)

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 0.2.0-beta.6 🎉

The release is available on npm package (@beta dist-tag)

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 0.2.0-beta.8 🎉

The release is available on npm package (@beta dist-tag)

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants