Comments (19)
It doesn't fix the issue.
from openapi-typescript-codegen.
I was on 0.27.0 when I was getting this error. Downgraded to 0.25.0, worked perfect
from openapi-typescript-codegen.
I should also note that, even if I pass an absolute path to --input, it still tries to append that to node_modules\@apidevtools\json-schema-ref-parser\dist
.
The only workaround I can come up with is to use ../../../..
instead of .
in front of my relative input path.
Curious how other people are getting this to work without the above hack, as otherwise the library appears to be unusable when using an input file. (Of course, downgrading is also an option, but not a nice one.)
from openapi-typescript-codegen.
Created a new release (0.27.0) https://github.com/ferdikoomen/openapi-typescript-codegen/releases/tag/v.027.0 please check if that resolves the issue
from openapi-typescript-codegen.
I am also experiencing this issue
from openapi-typescript-codegen.
same issue.
from openapi-typescript-codegen.
json-schema-ref-parser
i use [email protected] [email protected]
from openapi-typescript-codegen.
We had to downgrade too, tried the absolute path and overriding to the latest version of json-schema-ref-parser (11.1.0), still it just appends the absolute path to the package folder, really odd way of handling paths, wondering how this works for anyone.
from openapi-typescript-codegen.
Still not working, had to downgrade to 0.25.0
from openapi-typescript-codegen.
apidevtools/json-schema-ref-parse#311 the issue seems to be related to this one.
from openapi-typescript-codegen.
Seems indeed a json-schema-ref-parse issue, checking now
from openapi-typescript-codegen.
Easy solution for now, would be to revert json-schema-ref-parse
to 10.1.0 until they fix the issue. I will do that and publish a new release.
from openapi-typescript-codegen.
Created a new release (0.27.0) https://github.com/ferdikoomen/openapi-typescript-codegen/releases/tag/v.027.0 please check if that resolves the issue
hey,It doesn't fix the issue. try revert json-schema-ref-parse to 11.0.0
https://github.com/APIDevTools/json-schema-ref-parser/releases/tag/v11.0.0
Fix windows paths and external refs (APIDevTools/json-schema-ref-parser#321) (b9f91b2), closes APIDevTools/json-schema-ref-parser#321
BREAKING CHANGES
Change the file path parsing logic (to be safe)
from openapi-typescript-codegen.
Looking at the RefParser.parse
implementation it looks getOpenApiSpec
needs to be passing in a base path for relative paths to be resolved against and the recommended use case is to pass in a full file url.
https://github.com/APIDevTools/json-schema-ref-parser/blob/main/lib/index.ts#L58
from openapi-typescript-codegen.
This problem occured on Windows but not macOS, downgrading the package to 0.25 fixed it.
from openapi-typescript-codegen.
Upgrading to the latest version of @apidevtools/json-schema-ref-parser
seems to solve the issue? atleast in one of my test cases.
from openapi-typescript-codegen.
@StanlyLife we've got a different fix for this in our fork, could you give it a try and let me know if it works for you?
from openapi-typescript-codegen.
@mrlubos Is there any reason why you are maintaining a fork, is this repo dead?
from openapi-typescript-codegen.
@AnderssonPeter this should answer that question https://github.com/nicolas-chaulet/openapi-typescript-codegen?tab=readme-ov-file#why-the-fork
from openapi-typescript-codegen.
Related Issues (20)
- Type error: Type alias ‘XXX’ circularly references itself. HOT 14
- getFormData causes issue in submitting files HOT 1
- Type error: Private identifiers are only available when targeting ECMAScript 2015 and higher. HOT 22
- Relative external references for Angular client doesn't work HOT 1
- OpenAPI.ts `Resolver` typing is annoying, should use a `Maybe` type HOT 3
- While resolving: [email protected] HOT 1
- Unable to run when redocly is installed HOT 2
- Option to rename `requestBody` HOT 1
- Select/Filter Tags to generate specific Services only HOT 1
- Literal fields are converted to optional any HOT 5
- Adding the option to remove certain or all file headers. HOT 1
- Referenced nullable object types are not generated as possibly null HOT 4
- anyOf combining literals and objects generates incorrect code HOT 6
- Ability to process multiple input files HOT 5
- all Of -> $reference. HOT 3
- If all parameters are optional, make the top level object optional too HOT 4
- Generated type definitions should not include the error case HOT 3
- Relative path seems to be based on the node_modules directory and not the cwd HOT 3
- Support for Server Side Event HOT 3
- Wrong path on Windows HOT 16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openapi-typescript-codegen.