Open frankPairs opened 1 month ago
Hey @frankPairs, it can be an object, but it does not support what you're describing. This should be easy to add though. What's up with the "service1" naming? What's the expected output?
My first intuition is that the files generated from @generated/openapi-schemas/service1/service1.yaml
would be within the output folder using the same name. Just following the example describe above, it would look like:
I'd like to do something similar, but was thinking something like this would work, and found out it doesn't:
export default [
defineConfig({
client: '@hey-api/client-fetch',
input: 'https://api1/openapi.json',
output: 'src/clients/api1',
}),
defineConfig({
client: '@hey-api/client-fetch',
input: 'https://api2/openapi.json',
output: 'src/clients/api2',
}),
];
Like said by @frankPairs, i will be very interested by this functionnality because on my project i have several swagger, and i would wish they are classified by input name in output directory. But actually, I have this issue if i launch the command
npm run openapi
Unexpected error occurred. Unsupported OpenAPI specification: {
while in the documentation, the input type is a string or a Record<string, unknown>;
On project openapi-typescript-codegen
https://github.com/ferdikoomen/openapi-typescript-codegen/tree/main?tab=readme-ov-file
I was not bothered because I was running X commands (in the package.json) for X swagger to get the data generated.
openapi -i http://localhost:8080/api/xxxx/swagger.json -o src/api/xxxx --client axios --indent 2
Description
Hey everyone!
I am facing a challenge using the library. On the project I am working on, we have several microservices, each of them with its own OpenAPI schema, which means that I have to deal with different
.yaml
files.I am not sure if this is possible, but is there any way to declare several inputs instead of just one? kind of:
I was checking the ClientConfig documentation, and it looks like the input property can be an object, but I am doing something wrong because it's not working as I expected.
I would appreciate any guidance.
Thanks a lot in advance!