Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAPI shared components #564

Open
hrabkin opened this issue Apr 18, 2024 · 4 comments
Open

OpenAPI shared components #564

hrabkin opened this issue Apr 18, 2024 · 4 comments
Labels
kind/support Adopter support requests. status/triage Collecting information required to triage the issue.

Comments

@hrabkin
Copy link

hrabkin commented Apr 18, 2024

Question

How to union generated shared components from two different openapi sepcifications?

@hrabkin hrabkin added kind/support Adopter support requests. status/triage Collecting information required to triage the issue. labels Apr 18, 2024
@czechboy0
Copy link
Collaborator

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?

@czechboy0
Copy link
Collaborator

I'm trying to understand whether this is essentially a duplicate of #132 or if that doesn't work for you for some reason.

@hrabkin
Copy link
Author

hrabkin commented Apr 18, 2024

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.

@simonjbeaumont
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Adopter support requests. status/triage Collecting information required to triage the issue.
Projects
None yet
Development

No branches or pull requests

3 participants