Skip to content

Add complete plan flag to V2 API#3595

Open
momo3404 wants to merge 3 commits intoapi_v2_dmponlinefrom
momo/add-complete-flag
Open

Add complete plan flag to V2 API#3595
momo3404 wants to merge 3 commits intoapi_v2_dmponlinefrom
momo/add-complete-flag

Conversation

@momo3404
Copy link
Collaborator

@momo3404 momo3404 commented Feb 6, 2026

Changes proposed in this PR:

  • Add the complete 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 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?complete=true.
  • The schema the flag returns is as follows:
  •       "complete_plan": [
              {
                "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.

- Edit plan query to check for user role to prevent eager loading
- Add set_complete_param function that sets complete flag according to its value if its set to true in the API call
- Edit initialize to include complete flag, which is set to false as default
- If flag is true in call, call fetch_all_q_and_a
- Add fetch_all_q_and_a function that fetches questions and answers
- Add complete flag data to extension in json
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

</tr>
1 Error
🚫

Please include a CHANGELOG entry.

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

Generated by 🚫 Danger

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.

1 participant