ogen-go / ogen

OpenAPI v3 code generator for go
https://ogen.dev
Apache License 2.0
1.45k stars 86 forks source link

ease of collaborative work: file per schemas, client, server methods #1339

Open chaporgin opened 3 weeks ago

chaporgin commented 3 weeks ago

Hello and thank you for your great library.

Description

We commit the generated code into the repository. We work on some specifications resolving 5 features simultaneously. 2 developers rarely work on the same endpoint. Considering that, 4 pull requests with specification changes are often subject to rebase after one lucky person commits to the main branch. Thinking of how to improve the workflow I thought that the rebases would be less needed if the generated code were split more. Currently, we have the following files (among the others):

I believe they are the only source of frequent conflicts, unless when 2 new endpoints are being added, in that case oas_router_gen.go adds to the list above, but I believe this case should be out of scope.

My suggestion is to generate more files, so that:

Downsides: