Add functions to response models for schema-extraction #2379
Merged
mromaszewicz merged 4 commits intoMay 19, 2026
Conversation
Contributor
Greptile SummaryThis PR adds generated response-body getter methods for client response models. It changes:
Confidence Score: 5/5This looks safe to merge.
|
| Filename | Overview |
|---|---|
| pkg/codegen/templates/client-with-responses.tmpl | Adds default response getter generation behind the new output option. |
| configuration-schema.json | Documents the new skip-response-body-getters output option for schema validation. |
| internal/test/outputoptions/response-body-getters/enabled/response_body_getters_test.go | Verifies the default generated response type exposes GetBody() and typed getters. |
| internal/test/outputoptions/response-body-getters/skipped/response_body_getters_test.go | Verifies the opt-out config suppresses generated response-body getter methods. |
Reviews (2): Last reviewed commit: "Update config schema, regenerate everyth..." | Re-trigger Greptile
Member
|
I'm addressing Greptile's findings and pushing an update to your fork. |
- Add `skip-response-body-getters` to `configuration-schema.json` under `output-options` so schema-based config validation accepts the new flag (Greptile P1 on `configuration.go`). - Regenerate every committed `*.gen.go` fixture so the new default `GetBody()` and `Get<TypeName>()` response getters are reflected in the committed output (Greptile P1 on `client-with-responses.tmpl`). - Add `internal/test/outputoptions/response-body-getters/` covering both the default (`enabled/`) and opt-out (`skipped/`) code paths. The tests instantiate the generated response type and use reflection to assert the getters are present or absent as configured.
Member
|
@greptileai, review latest patch |
mromaszewicz
approved these changes
May 19, 2026
lwc
pushed a commit
to lwc/oapi-codegen
that referenced
this pull request
Jun 23, 2026
…2379) * added Getter functions for response bodies * add configuration option to skip response body getter generation * Update config schema, regenerate everything - Add `skip-response-body-getters` to `configuration-schema.json` under `output-options` so schema-based config validation accepts the new flag (Greptile P1 on `configuration.go`). - Regenerate every committed `*.gen.go` fixture so the new default `GetBody()` and `Get<TypeName>()` response getters are reflected in the committed output (Greptile P1 on `client-with-responses.tmpl`). - Add `internal/test/outputoptions/response-body-getters/` covering both the default (`enabled/`) and opt-out (`skipped/`) code paths. The tests instantiate the generated response type and use reflection to assert the getters are present or absent as configured. --------- Co-authored-by: Marcin Romaszewicz <marcinr@gmail.com>
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 #2191