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

Upgrade to v.0.26.0 of openapi-typescript-codegen #42

Closed
andrecarrblad opened this issue Feb 16, 2024 · 17 comments · Fixed by #50
Closed

Upgrade to v.0.26.0 of openapi-typescript-codegen #42

andrecarrblad opened this issue Feb 16, 2024 · 17 comments · Fixed by #50

Comments

@andrecarrblad
Copy link

Hi,

A new version of openapi-typescript-codegen is available (v.0.26.0), which includes upgraded dependencies. This update specifically addresses a warning related to deprecated usage of json-schema-ref-parser.

Previously, the codebase was triggering the following warning:
npm WARN deprecated json-schema-ref-parser@9.0.9: Please switch to @apidevtools/json-schema-ref-parser

Best regards,
André

@AnderssonPeter
Copy link

AnderssonPeter commented Feb 23, 2024

@7nohe is there any reason this has not been done? If not would you accept a PR?

@7nohe
Copy link
Owner

7nohe commented Feb 23, 2024

I tried upgrading to v0.26.0 once, but it was failing the Windows test, so I reverted back to v0.25.0. It seems that v0.27.0 has been released, so I would like to try it again.

@7nohe 7nohe linked a pull request Feb 23, 2024 that will close this issue
@7nohe
Copy link
Owner

7nohe commented Feb 23, 2024

I created a PR, but the Windows test still failed.
It seems there is an issue with json-schema-ref-parser regarding Windows.
APIDevTools/json-schema-ref-parser#303

@AnderssonPeter
Copy link

@7nohe I'm a bit unsure how windows handles a \.\ in a path
image

@AnderssonPeter
Copy link

What happens if you change node ../../dist/src/cli.js -i ./petstore.yaml -c axios --exportSchemas=true --postfixServices=Client --request ./request.ts to node ../../dist/src/cli.js -i petstore.yaml -c axios --exportSchemas=true --postfixServices=Client --request request.ts?
Also the path seperators here are linux not windows, unsure if that is a problem or not.

@7nohe
Copy link
Owner

7nohe commented Feb 28, 2024

@AnderssonPeter I tried it, but it didn't work.

@AnderssonPeter
Copy link

@7nohe I tried to run it locally and the file does not exist in the location that it looks for it.
image
But path seems off as it does exist in examples\react-app\petstore.yaml, so the question is why does it look for it inside json-schema-ref-parser instead of the current working directory.

@AnderssonPeter
Copy link

AnderssonPeter commented Feb 29, 2024

Adding the following seems to solve the issue

  "peerDependencies": {
    "commander": ">= 11 < 13",
    "glob": ">= 10",
    "openapi-typescript-codegen": "^0.24.0",
    "@apidevtools/json-schema-ref-parser": "^11.1.0", <---
    "typescript": ">= 4.8.3"
  }

What side effects it would have i don't know.

My guess is that the issue is that openapi-typescript-codegen should upgrade its dependencies ferdikoomen/openapi-typescript-codegen#1970

@AnderssonPeter
Copy link

@7nohe using https://github.com/nicolas-chaulet/openapi-typescript-codegen instead might solve this issue, and add support for the date type.

@7nohe
Copy link
Owner

7nohe commented Mar 16, 2024

Thank you for the suggestion. I've been considering that relying on external libraries for client code generation might not be ideal, so I am exploring the possibility of creating my own.

@AnderssonPeter
Copy link

AnderssonPeter commented Mar 16, 2024

I haven't tested but it should be fairly compatible as it's a fork.

@AnderssonPeter
Copy link

@7nohe They released a new version of openapi-typescript-codegen 0.28.0 that should resolve the windows issue, but i would still prefer the fork as it handles dates.

@7nohe
Copy link
Owner

7nohe commented Mar 23, 2024

@AnderssonPeter Thank you for letting me know about the new release. I will try upgrading to the new version.

The fork project you told me about seems to have been renamed to @hey-api/openapi-ts and is well-maintained, so I'm thinking of switching to it.

@seriouslag
Copy link
Collaborator

seriouslag commented Mar 23, 2024

@AnderssonPeter Thank you for letting me know about the new release. I will try upgrading to the new version.

The fork project you told me about seems to have been renamed to @hey-api/openapi-ts and is well-maintained, so I'm thinking of switching to it.

Opened PR using the @hey-api/openapi-ts

@7nohe 7nohe closed this as completed in #50 Apr 9, 2024
@AnderssonPeter
Copy link

@7nohe are there any plans to enable the https://heyapi.vercel.app/openapi-ts/transformers.html#dates function when --useDateType flag is used?

@7nohe
Copy link
Owner

7nohe commented Aug 6, 2024

@AnderssonPeter It looks possible, so I would appreciate it if you could create a new issue.

@AnderssonPeter
Copy link

@7nohe done #137

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants