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

Split only the schemas #1502

Open
krishnan-techconative opened this issue Mar 25, 2024 · 3 comments
Open

Split only the schemas #1502

krishnan-techconative opened this issue Mar 25, 2024 · 3 comments

Comments

@krishnan-techconative
Copy link

Is your feature request related to a problem? Please describe.

It would be beneficial to have a capability that allows us to isolate only the schemas from the source openApi.yaml file, leaving the paths intact

Describe the solution you'd like

Perhaps we could implement a flag or configuration option to facilitate splitting only the schemas located within the 'components' section, effectively replacing the references in the openapi.yaml file.

@lornajane
Copy link
Collaborator

We're unlikely to add another configuration option because it's so easy to end up with a huge and bewildering number of them, but I'm curious to hear more about your use case. Could you say something about why either splitting the API description, or maintaining a schema with an alternative manual structure, aren't working well for you?

@krishnan-techconative
Copy link
Author

Hi @lornajane

First, let me thank you for your prompt response.

Initially, our development process involved using the OpenAPI spec without organizing it into multiple files. This approach was followed across more than 25 services. Essentially, we utilized the open-api-generator Maven plugin to generate server code and model classes. However, we've now recognized the need to separate schemas for easier maintenance. I experimented with Redocly Split, which effectively splits schemas and paths. However, upon splitting, the OpenAPI generator fails to generate server code and models correctly. It attempts to create a separate model class for one of the properties, which is incorrect. Therefore, I aim to split only the schemas, not the paths, across all services without manual intervention. In my search for a solution, I came across your tool and identified it as potentially aiding in this schema-splitting task."

@lornajane
Copy link
Collaborator

I think I understand. It's a common use case to split the OpenAPI descriptions to make easier maintanance, but as you have already discovered, not all tools support that structure. I suggest that you use the split structure as the source of truth, but try bundling the API description back to a single file before passing it to the code generator tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants