Comments (10)
Unfortunately I am not. I would like to though. The official generators are lacking in so many other ways.
Don't worry, we'll get there. Keep listing any issues you're seeing elsewhere and we'll figure it out!
from openapi-ts.
@tajnymag a little update: this will work only with --useOptions
, so please make sure you're using that flag. Out of interest, are you able to share your config?
I explored this a bit and the conclusion is that we will need to rework types quite a bit, it's not a quick fix. That pull request you linked doesn't implement it properly either and I'd rather wait until it works as expected than go through multiple iterations here
from openapi-ts.
@tajnymag just want to clarify the expected example types. Aren't they meant to be like this?
UserGetResponse: { id?: number, username?: string }
UserPostRequest: { username?: string, password?: string }
UserPutRequest: { username?: string, password?: string }
UserPatchRequest: { username?: string, password?: string }
from openapi-ts.
@tajnymag just want to clarify the expected example types. Aren't they meant to be like this?
UserGetResponse: { id?: number, username?: string } UserPostRequest: { username?: string, password?: string } UserPutRequest: { username?: string, password?: string } UserPatchRequest: { username?: string, password?: string }
Yeah, they should. You are right.
from openapi-ts.
@tajnymag okay let me think about this. I pushed some changes yesterday that extract types for data objects when using --useOptions
, more cool stuff to follow.
P.S. I believe --useOptions
should be the default setting, and plan to support mostly that flag in the future
from openapi-ts.
@mrlubos Unfortunately I don't have anything to share. As I really needed multipart forms supported I've used the official openapi generator. Similarly, as the readOnly and writeOnly properties weren't well supported by any generator I had found, I manually created schemas for requests and responses.
from openapi-ts.
@tajnymag are you not currently using this package then?
from openapi-ts.
@tajnymag are you not currently using this package then?
Unfortunately I am not. I would like to though. The official generators are lacking in so many other ways.
from openapi-ts.
Why don't you use https://github.com/drwpow/openapi-typescript @tajnymag?
from openapi-ts.
Why don't you use https://github.com/drwpow/openapi-typescript @tajnymag?
I didn't want to hardcode any urls into the client. Also I subjectively dislike the API of drwpow/openapi-typescript
from openapi-ts.
Related Issues (20)
- Export types from `@hey-api/client-fetch` HOT 5
- There will be an error when operationId is a js keyword, I think we should give this class a prefix or something HOT 7
- Login API with OAuth2PasswordRequestForm Fails Due to Incorrect Content-Type HOT 6
- Dependency-free support for new Fetch API client
- Node.js errors seem not caught by the library HOT 1
- Downloading a PDF file from generated contract throws error as treating file a JSON HOT 5
- Unable to prompt browser to save file with 'content-disposition: attachment;' HOT 4
- Explicit type annotation for all exports HOT 2
- Shared clients functionality
- uni-app client + client APIs HOT 7
- How Image Serve is handled from the backend? HOT 3
- Can't manage to download attachment file HOT 6
- Use tsup for dual publishing
- Add sponsorships HOT 4
- Handling Error Responses in Login API with OpenAPI Specification HOT 5
- is there any way to override the Content-Type to make it undefined HOT 2
- Spec Generates "Unknown" Type in Client Code for non empty body request HOT 4
- Support mutationOptions generation for `@tanstack/react-qury` HOT 1
- Error responses should generate a TypeScript union, not an intersection HOT 1
- Please add a GitHub sponsor button! HOT 1
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-ts.