Use net/http constants in boilerplate#2398
Open
mromaszewicz wants to merge 1 commit into
Open
Conversation
e06f625 to
31d000a
Compare
Contributor
Greptile SummaryThis PR replaces generated raw HTTP status numbers with
Confidence Score: 5/5This looks safe to merge.
|
| Filename | Overview |
|---|---|
| pkg/codegen/operations.go | Adds the fixed status-code to net/http constant mapping used by generated output. |
| pkg/codegen/template_helpers.go | Updates generated client response conditions to compare against HTTP status constants. |
| pkg/codegen/templates/strict/strict-interface.tmpl | Emits HTTP status constants for fixed strict-server response codes. |
| pkg/codegen/templates/strict/strict-fiber-interface.tmpl | Emits HTTP status constants for fixed Fiber strict-server responses. |
| pkg/codegen/templates/strict/strict-iris-interface.tmpl | Emits HTTP status constants for fixed Iris strict-server responses. |
Reviews (2): Last reviewed commit: "Use net/http constants in boilerplate" | Re-trigger Greptile
Closes: oapi-codegen#2397 Replace raw integer literals in generated strict server code with named net/http constants (e.g. http.StatusOK instead of 200). Covers WriteHeader/Status/StatusCode calls in all strict server templates and status code comparisons in generated client switch statements. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
31d000a to
3988907
Compare
Member
Author
|
@greptileai, please look again, comments addressed. |
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.
Closes: #2397
Replace raw integer literals in generated strict server code with named net/http constants (e.g. http.StatusOK instead of 200). Covers WriteHeader/Status/StatusCode calls in all strict server templates and status code comparisons in generated client switch statements.