Skip to content

Initialize v2 API#731

Merged
vincent-olivert-riera merged 2 commits into
line:masterfrom
hoangpn:feature/v2_api
May 21, 2026
Merged

Initialize v2 API#731
vincent-olivert-riera merged 2 commits into
line:masterfrom
hoangpn:feature/v2_api

Conversation

@hoangpn
Copy link
Copy Markdown
Contributor

@hoangpn hoangpn commented May 20, 2026

This PR is to initialize the development of Promgen's v2 API.

Summary:

  • A new router has been created. New APIs will have the prefix /rest/v2 in the endpoint and belong to the api-v2 namespace.
  • A dedicated View for documenting the new APIs is implemented using drf-spectacular and RapiDoc.
  • The API Schema is generated according to the OpenAPI 3.0 standard.
  • PromgenPagination class is created to support paginated responses.
  • PromgenGuardianRestPermission class is added to serve per-object permission checks with logic similar to Promgen Web.
  • A new API for retrieving and filtering Audit Log data has been added to verify the new codebase.

@hoangpn hoangpn force-pushed the feature/v2_api branch 3 times, most recently from 66aeec4 to 3104318 Compare May 20, 2026 10:04
Copy link
Copy Markdown
Contributor

@vincent-olivert-riera vincent-olivert-riera left a comment

Choose a reason for hiding this comment

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

Just a minor thing about the rapidoc script import.
Everything else looks fine to me.

Comment thread promgen/templates/base.html Outdated
Comment on lines +69 to +70
<script src="{% static 'js/promgen.vue.js' %}?v=7"></script>
<script type="module" src="{% static 'js/rapidoc.min.js' %}" integrity="sha384-rpBuyGgeMsj+36JZKKBL7CBL9FIcPWbyA3YBRJZEAa37nT1P8rxUl/s9EwJE6zSE" crossorigin="anonymous"></script>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same as we did for VueJS, could you please store the rapidoc.min.js file inside its own directory with the version on its name? For instance js/rapidoc-9.3.8/rapidoc.min.js.

Also, better format this line:

  <script
    type="module"
    src="{% static 'js/rapidoc-9.3.8/rapidoc.min.js' %}"
    integrity="sha384-rpBuyGgeMsj+36JZKKBL7CBL9FIcPWbyA3YBRJZEAa37nT1P8rxUl/s9EwJE6zSE"
    crossorigin="anonymous"
  ></script>

@vincent-olivert-riera vincent-olivert-riera dismissed their stale review May 21, 2026 06:16

I approved by mistake.

Copy link
Copy Markdown
Contributor

@vincent-olivert-riera vincent-olivert-riera left a comment

Choose a reason for hiding this comment

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

You need to leave a comment indicating the requested changes.

🤷

hoangpn added 2 commits May 21, 2026 13:51
We have added basic settings aimed at supporting the development of Promgen's v2 API.
Summary:
- A new router has been created. New APIs will have the prefix /rest/v2 in the endpoint and
belong to the api-v2 namespace.
- A dedicated View for documenting the new APIs is implemented using drf-spectacular and RapiDoc.
- The API Schema is generated according to the OpenAPI 3.0 standard.
- PromgenPagination class is created to support paginated responses.
- PromgenGuardianRestPermission class is added to serve per-object permission checks with logic
similar to Promgen Web.
We have added a new API for retrieving and filtering Audit Log data.
@hoangpn
Copy link
Copy Markdown
Contributor Author

hoangpn commented May 21, 2026

@vincent-olivert-riera
Thank you so much for reviewing. I have made the following changes and force-pushed due to minor changes.
Please help me to re-review. 🙇

Copy link
Copy Markdown
Contributor

@vincent-olivert-riera vincent-olivert-riera left a comment

Choose a reason for hiding this comment

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

Looks good to me :)

@vincent-olivert-riera vincent-olivert-riera merged commit e225dc7 into line:master May 21, 2026
5 checks passed
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