Skip to content

PATCH /responses/{responseID}のrequest bodyから不要な情報を除く #1307

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

Merged
merged 3 commits into from
May 19, 2025

Conversation

Eraxyso
Copy link

@Eraxyso Eraxyso commented May 5, 2025

Closes #1295

@Eraxyso Eraxyso requested a review from kaitoyama May 5, 2025 19:43
@Eraxyso Eraxyso requested a review from Copilot May 14, 2025 06:29
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes unnecessary information from the PATCH /responses/{responseID} request body by introducing a new EditResponse model and updating related request types and schema references.

  • Introduced an EditResponse struct in openapi/types.go with Body, IsDraft, and ResponseId fields.
  • Updated the JSON request body alias and swagger schema references to use EditResponse instead of Response.
  • Adjusted tests and controller logic to consume the new EditResponse structure and remove duplicate data retrieval.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
openapi/types.go Added EditResponse model and updated type alias.
openapi/spec.go Updated embedded Swagger spec strings accordingly.
docs/swagger/swagger.yaml Changed schema reference and added EditResponse schema.
controller/response_test.go Updated test to use EditResponse for request body.
controller/response.go Removed duplicate respondent detail retrieval.
Comments suppressed due to low confidence (2)

openapi/types.go:171

  • [nitpick] Consider renaming the field 'ResponseId' to 'ResponseID' for consistency with Go naming conventions regarding acronyms.
ResponseId *int           `json:"response_id,omitempty"`

controller/response_test.go:975

  • [nitpick] Ensure that the test validates the new ResponseId field; add assertions to check that ResponseId is correctly set in the response.
var responseEditPost openapi.EditResponseJSONRequestBody

Copy link
Contributor

@kaitoyama kaitoyama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMです!

@Eraxyso Eraxyso merged commit d72b392 into fix/openapi May 19, 2025
7 checks passed
@Eraxyso Eraxyso deleted the fix/openapi-editresponse_schema branch May 19, 2025 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants