Open hrabkin opened 2 weeks ago
Hi @hrabkin, can you clarify what you mean by "union"?
You can generate content from two OpenAPI documents into two Swift modules, and if you add accessModifier: package
(or public
), you can then have a third Swift module that imports the first two, and uses types from both.
Are you writing a client or a server? Can you add more details on what you're trying to do?
I'm trying to understand whether this is essentially a duplicate of https://github.com/apple/swift-openapi-generator/issues/132 or if that doesn't work for you for some reason.
No its not a duplicate. Its a different issue, that one not related.
So I have two apis described in openapi yaml: A -> which have some shared components S, and B which uses the same shared components S. I generate two libraries from the yamls and of course there are two duplicate types now AS and BS.
So I have two apis described in openapi yaml: A -> which have some shared components S, and B which uses the same shared components S. I generate two libraries from the yamls and of course there are two duplicate types now AS and BS.
I'm not sure I understand.
If by "two apis" you mean you have two operations in the OpenAPI document that make use of the same type in #/components/schemas
, then these will use the same type. Or are you saying you two independent services in the one YAML file?
Would you be able to provide a minimal example to help us understand better?
Question
How to union generated shared components from two different openapi sepcifications?