-
-
Notifications
You must be signed in to change notification settings - Fork 33
feat!: changing openapi generator #50
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
Conversation
Will this pr also enable the date type? If I remember correctly they somehow converted dates to the JavaScript type Date, I'm a bit unsure if that happened automatically or if you had to enable it. |
The property can be enabled, but I still need to test it. If you can, please pull this branch and test your use case. |
Once this is merged and a new release has been created, then i could test it. |
I tried to run it but I'm getting compilation errors, I'm a bit unsure how to run it from source.. But when i run
|
Thank you for testing it out. To run from source:
It appears your source built and is failing on the |
@AnderssonPeter I tested the useDateType property. |
5d7cd9c
to
725ddc8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seriouslag That's excellent work. Thank you very much.
I would appreciate it if you could also make changes to the part on line 9 of the README.
- Supports the option to use pure TypeScript clients generated by OpenAPI Typescript Codegen
I'm fairly certain I did the steps you listed, I ran it on node 18 I think, but not 100 sure as I'm not at my PC. |
725ddc8
to
85999aa
Compare
Updated readme. Do we want to merge with the underlying client being below version one? |
92c5728
to
1f00dcb
Compare
What functionality? |
An active PR is not a good place to self-promote your thoughts about planned functionality in a different project. |
Gotcha @seriouslag. I will delete my previous comments, just wanted to get a sense on the idea. Thanks for your feedback! |
1f00dcb
to
9777225
Compare
I was able to duplicate the issue; I now converted all files to mjs, which I believe will fix this issue. |
9777225
to
e09fc02
Compare
Changed openapi code generator to @hey-api/openapi-ts. Not supporting all properties yet. Supporting new properties: - base - serviceResponse - enums - useDateType indent and useUnionTypes properties were removed left in for backwards compatibility. BREAKING CHANGE: changed from cjs to mjs
e09fc02
to
621f2b6
Compare
Updated PR to support the --useOptions of @hey-api/openapi-ts. |
- removed deprecated options of @hey-api/openapi-ts - using ts-morph to help traverse typescript source files
621f2b6
to
baafa2d
Compare
Messed this value up in a merge
👏🏼 👏🏼 👏🏼 👏🏼 Looking forward this new generator. |
It's working nicely on my PC, so let's go ahead and merge this and release it! |
Changed openapi code generator to @hey-api/openapi-ts.
Note: @hey-api/openapi-ts is rapidly changing its API.
We should consider that before merging to main.
Supporting new properties:
BREAKING CHANGE:
--indent, --postfixModels, --postfixServices and --useUnionTypes properties were removed in @hey-api/openapi-ts.
Removed them from this API.
BREAKING CHANGE:
I converted this library to a Javascript module, setting the type module in the package.json and changing TSC to compile to NodeNext. This is not a breaking change for most consumers of this package, but it could be for older node versions.
This was needed to build with @hey-api/openapi-ts.
Closes: #42
I tested the --useDateType property. It works as specified in the @hey-api/openapi-ts library.
However, it only changes the generated model to a JS Date object and doesn't convert the string to a Date object.
As the model doesn't match the data.
I have opened an issue in that library.
Note: I added a new library to help traverse TS source files, ts-morph