openapi-ts icon indicating copy to clipboard operation
openapi-ts copied to clipboard

Generating code based on multiple OpenAPI schemas

Open frankPairs opened this issue 1 year ago • 7 comments

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:

import { defineConfig } from '@hey-api/openapi-ts'

export default defineConfig({
  client: '@hey-api/client-axios',
  input: {
     "service1": '@generated/openapi-schemas/service1/service1.yaml',
     "service2": '@generated/openapi-schemas/service2/service2.yaml',
     ...
  },
  output: {
    format: 'prettier',
    lint: 'eslint',
    path: '@generated/api',
  },
})

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!

frankPairs avatar Sep 18 '24 10:09 frankPairs