Comments (8)
@anchan828 the root index.ts should export all models and services. Are you able to import multiple models from there instead?
Whoops, just re-read your issues and see. You are only including the models. This should be do-able.
from openapi-ts.
@anchan828 I have added this and released it in version 0.28.0.
from openapi-ts.
@anchan828 Im curious if you can share how your repository is structured? Could you use a mono repo where the generated client is one package and other can use it as a dependency?
from openapi-ts.
NOTE: im thinking we could add models/index.ts
and services/index.ts
and schemas/index.ts
These would export all of the models/services/schemas. Then in the root index.ts
, instead of exporting each manually we export * from './models
(Check if config has exporting enabled for models/service/schemas).
from openapi-ts.
@jordanshatford I have two repositories.
- There is a backend repository where I do integration testing with code generated by openai-ts.
- There is a frontend repository where I have my own HTTP client and validation, so I don't use services or schemas, but I cast the resulting data in models types. This is completely on my side, but I can't package it, so I copy it and add the file from backend to frontend repository.
from openapi-ts.
Hey @anchan828, thanks for opening an issue! A couple questions
- Why are you using your own HTTP client and not one of the generated ones?
- Why aren't you using one of the other OpenAPI types generators that don't come with any HTTP client if that's all you need?
from openapi-ts.
Hi @mrlubos,
- Why are you using your own HTTP client and not one of the generated ones?
Sorry, I can't explain it convincingly, but what I can say is that the frontend system already has an HTTP client, so switching to the openapi-ts's HTTP client is not an immediate option.
- Why aren't you using one of the other OpenAPI types generators that don't come with any HTTP client if that's all you need?
This is because there is no point in going to the trouble of using two generators.
When I was using openapi-generator, it took 5 seconds, but with openapi-ts, I can now generate it in less than 100~150ms, so the speed of generation is one of the main reasons I use openapi-ts. 😀
from openapi-ts.
Thanks for the additional context! Ideally, you wouldn't have to use a custom client when using this package, so if there's anything we can do to bridge that gap between our generated client and what you use, please let us know!
from openapi-ts.
Related Issues (20)
- schema compliance with jsr HOT 3
- Allow inlining types in services signature instead of reference to $OpenApiTs HOT 1
- Allow easy differentiation by status codes HOT 4
- invalid identifier created (starting with digits) HOT 1
- formData: mismatch Type HOT 5
- Remove service classes
- Typescript enums not generated HOT 3
- Default response types (error) override response types HOT 3
- Setting a custom httpsAgent on the generated AxiosInstance HOT 9
- Accessing Both Response Body and Headers HOT 2
- Export `OpenApiSchema` interface in the generated client HOT 2
- Pass APIRequestOptions to the response interceptor
- Client instance duplicate identifier
- Specify Line Endings HOT 1
- Dryrun flag checking causes the app not to run. HOT 8
- Inconsistent URL Encoding in Generated Services HOT 3
- Question regarding license HOT 9
- Switch to AbortSignal instead of CancellablePromise HOT 2
- Missed type for `type: ['array']`, produces unknown[] HOT 11
- Should "default" spec responses throw an error? 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.