Repository navigation
docs: record the generated code policy in the contribution guide - #33
Merged
Merged
Conversation
States plainly that OpenAPI output is committed exactly as the generator emits it: never hand-edited, never reformatted, excluded from linting and formatting, and out of scope for code review, security review and audit. The tooling already worked this way, but nothing said so, and the gap had consequences. A hand-applied fix in this fleet was silently destroyed by regeneration, and generated code was reformatted to satisfy a lint gate that should have excluded it instead. Both are now written down, along with where the exclusion is configured and where a real fix belongs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Records a policy the tooling already follows but nothing wrote down.
The policy
OpenAPI output is committed exactly as the generator emits it:
The section also records where the exclusion is configured in this repository, and where a real fix belongs instead: upstream in the specification, in the generator invocation, or via
.openapi-generator-ignorewhen the generator's copy of a file is genuinely not the source of truth.Why now
The gap between what the tooling did and what was written down had real consequences, both surfaced by a deliberate test dispatch of specification v2.0.1 and v2.0.2:
sdk-gohad the generator's debug logging removed by hand, because it dumps request bodies and would write plaintext transaction PII to the log. Nothing recorded that decision, so every regeneration restored it. Fixed in fix(openapi): stop regeneration restoring body-dumping debug logs sdk-go#27.sdk-java'sopenapi/pom.xmlhad a hand-added<parent>block linking it to the reactor. Regeneration deleted it and rewrote the artifact version, and CI passed anyway. Fixed in fix(openapi): stop regeneration clobbering the openapi module pom sdk-java#35.sdk-dotnet. Corrected in ci: exclude generated code from formatting, and pin the package guid sdk-dotnet#27, which brings .NET into line with the exclusionssdk-nodeandsdk-rustalready had.Every one of those is a documentation failure as much as a tooling one. Someone made a correct decision, and nothing carried it forward.
Scope
Documentation only. No code, configuration or workflow changes. The same section is being added to all five generating SDKs.
sdk-cppandsdk-pythonare not included: both are hand-written with no generated layer, and their contribution guides already state that explicitly.