roadmap icon indicating copy to clipboard operation
roadmap copied to clipboard

[DRAFT] Add question and answer flag to V2 API

Open momo3404 opened this issue 3 weeks ago • 1 comments

Changes proposed in this PR:

  • Add the question_and_answer flag to the V2 API to enable accessing all questions and answers belonging to a plan in the API response.
  • Per the V2 API Documentation: "The idea is to have a flag titled something like questions_and_answers=true, which defaults to false and thereby is compliant with the RDA metadata standard, but can be passed in with a value of true to include the questions and answers of the plan."
  • The flag is optional and works with the api/v2/plans and api/v2/plans/[plan_id] endpoints. For example: api/v2/plans/12345?question_and_answer=true.
  • The schema the flag returns is as follows:
  •       "questions_and_answers": {
            "15476": [
              {
                "title": "Question 1",
                "question": "<p>What considerations will you take into account with respect to ethical, legal, or commercial issues?</p>\r\n<p><br>Describe any applicable ethical, legal, or commercial considerations related to your project and data. This includes research involving Indigenous communities and knowledges, human subjects, legal and commercial considerations/agreements, partnerships or data with a high level of risk associated with it.</p>",
                "answer": "<p>test</p>"
              },
              {
                "title": "Question 2",
                "question": "<p>What data will you collect or otherwise bring into your project under this plan?</p>\r\n<p><br>Describe the data that will be collected, generated, and/or acquired.</p>",
                "answer": "<p>test</p>"
              },
            ]
          }
    
  • Questions with no answers are not included in the response.
  • The following file includes an example response to the call api/v2/plans/15476?question_and_answer=true response.json

momo3404 avatar Dec 19 '25 20:12 momo3404

</tr>
1 Error
:no_entry_sign:

Please include a CHANGELOG entry.

You can find it at [CHANGELOG.md](https://github.com/DMPRoadmap/roadmap/blob/main/CHANGELOG.md).

Generated by :no_entry_sign: Danger

github-actions[bot] avatar Dec 19 '25 20:12 github-actions[bot]