Comments (5)
Ah if you’re looking to bundle schemas, then you should use the Redocly CLI bundle command. That needs to be run before openapi-typescript.
I’d welcome an addition to the docs that clarifies this (perhaps something like a tip added):
::: tip
This will preserve schemas 1:1 input:output. To bundle multiple schemas into one, use Redocly’s [bundle command](https://redocly.com/docs/resources/multi-file-definitions/#bundle)
:::
Feel free to adjust the wording 🙂
from openapi-typescript.
On the same topic what if we have:
reference.json
- which contains$defs
openapi.yaml
file that references the defs from thereference.json
file
Is it possible to make it work? I don't see an example of this use case in the docs.
from openapi-typescript.
@drwpow Thanks for your response. In particular your call out that This will preserve schemas 1:1 input:output
suggests to me that the existing documentation example should be updated in the following way:
Current
apis:
core@v2:
root: ./openapi/openapi.yaml
x-openapi-ts:
output: ./openapi/openapi.ts
external@v1:
root: ./openapi/external.yaml
x-openapi-ts:
output: ./openapi/openapi.ts
Updated
apis:
core@v2:
root: ./openapi/openapi.yaml
x-openapi-ts:
output: ./openapi/openapi.ts
external@v1:
root: ./openapi/external.yaml
x-openapi-ts:
output: ./openapi/external.ts # note updated name
Does this make sense to you, or am I still confused on how this is meant to work?
from openapi-typescript.
@melissag yes! Apologies for not even noticing the typo in the docs. Yes that’s confusing, and your proposal is exactly how it should work. Would welcome a PR if you have time!
from openapi-typescript.
Done, thanks for the guidance! Let me know if I goofed on anything in the PR process, not super familiar.
from openapi-typescript.
Related Issues (20)
- Transform only transforms referenced schemas HOT 1
- Hoping to wrap the client for single arg calls
- Metadata generation
- Allow client option for custom dispatcher into fetch requests (e.g. to disable certificate validation) HOT 6
- advice on how to connect a frontend (swagger?) while using this lib
- Set baseUrl per request
- 0.9.4 breaks some Typescript configurations HOT 3
- Response types from openapi-fetch ignore null values
- Multiple security schemes not supported
- With React Query: Invariant: headers() expects to have requestAsyncStorage, none available. HOT 3
- `--properties-required-by-default` and `--default-non-nullable` flags do not work HOT 1
- Nested object's properties are mapped to unknown, but in OpenAPI they are typed correctly HOT 3
- "AdditionalProperties" reflects onto existing properties and causes TypeScript compile errors HOT 1
- Issues with references (`$ref`) resolution HOT 2
- Error with negative numbers in enums HOT 2
- Allow for custom types in path params serialization (and maybe other places serialization too)
- Types derived for oneOf construct result in TS2502 error HOT 3
- Uncaught error when body is `undefined` in request init HOT 6
- 'path' does not exist in type '{ query?: Record<string, unknown> | undefined; }' HOT 4
- issue on - generate client when yaml has mutiple same external ref
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-typescript.