-
Notifications
You must be signed in to change notification settings - Fork 4
ResponseBodyにquestion idを含める #1305
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
全体としてはLGTMです!
一か所説明をコメントで足しておいてください!
@@ -72,6 +74,35 @@ func setupSampleResponse() { | |||
} | |||
} | |||
|
|||
func AddQuestionID2SampleResponse(questionnaireID int) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここに、この関数の目的だけコメントで書いておいてほしいです
…question_id in request body from being modified during use
There was a problem hiding this 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 pull request adds a new field "question_id" to the ResponseBody and updates related serialization, OpenAPI spec, controller logic, and tests. Key changes include:
- Modifications in openapi/types.go to marshal and unmarshal the new "question_id" field.
- Updates to the OpenAPI spec in docs/swagger/swagger.yaml to reflect the added field.
- Adjustments in controller and test files to set and validate the new field, including synchronization in tests.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
openapi/types.go | Added QuestionId field and updated JSON marshalling/unmarshalling logic. |
openapi/spec.go | Modified schema definition to include question_id with allOf composition. |
controller/response_test.go | Updated tests to set QuestionId and added mutex for concurrent test access. |
controller/response.go | Adjusted validation logic for ResponseBody; now iterates over responseMetas. |
controller/questionnaire_test.go | Updated tests to include added QuestionId in responses. |
controller/questionnaire.go | Updated response creation with new QuestionId field and validations. |
controller/adapter.go | Mapped model QuestionID to openapi.ResponseBody.QuestionId. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## fix/openapi #1305 +/- ##
===============================================
- Coverage 62.60% 62.39% -0.21%
===============================================
Files 25 25
Lines 4115 4146 +31
===============================================
+ Hits 2576 2587 +11
- Misses 1199 1215 +16
- Partials 340 344 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Closes #1293