Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParserError due to changes in @apidevtools/json-schema-ref-parser dependency #267

Closed
tornermarton opened this issue Mar 7, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@tornermarton
Copy link

tornermarton commented Mar 7, 2023

I got the following error trying to parse a YAML file: ParserError unknown tag !tag:yaml.org,2002:timestamp.

As I investigated the cause, I found that the package @apidevtools/json-schema-ref-parser changed and since 9.1.x, the default parser used by the library does not add some types (e.g. timestamp) from the YAML 1.2 spec. As the package is listed as ^9.0.9 in the package.json, a new installation comes with the 9.1.2 version which prevents me to parse the (correct) YAML file.

My current solution was to overwrite the globally installed package (which is not a good solution as far as I know but gets the job done):

npm install -g ng-openapi-gen
cd ~/.nvm/versions/node/v16.19.0/lib/node_modules/ng-openapi-gen/
npm install @apidevtools/json-schema-ref-parser@9.0.9

Is there a better way to install the package with explicit dependency version or a configuration option for the CLI which allows me to use a different parser?

@luisfpg luisfpg added the bug Something isn't working label Aug 24, 2023
FlorianGrimm pushed a commit to FlorianGrimm/ng-openapi-gen that referenced this issue Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants