Skip to content

Deploy OpenAPI with Github Actions#1384

Closed
dmohns wants to merge 20 commits intomainfrom
Improve-OpenAPI-docs-generation
Closed

Deploy OpenAPI with Github Actions#1384
dmohns wants to merge 20 commits intomainfrom
Improve-OpenAPI-docs-generation

Conversation

@dmohns
Copy link
Copy Markdown
Member

@dmohns dmohns commented Mar 17, 2026

Brief summary of the change made

This PR implements a few improvements around our OpenAPI docs (and their generation)

  • Fix scribe:generate to use actual authentication. Previously most auto generated entries simply showed un-authenticated error
    image

    This now works much better:

    image
  • Fix some errors thrown related to wrong path of response files

  • Remove openapi.yaml from version control. It's should be treated like a generated artifact. Update the docs deployment pipeline to generate it on the fly.

Note

The motivation for this change is to generally improve and overhaul our API documentation.
As we need to share it with external parties and collaborateurs like Vodacom.

Are there any other side effects of this change that we should be aware of?

Describe how you tested your changes?

Pull Request checklist

Please confirm you have completed any of the necessary steps below.

  • Meaningful Pull Request title and description
  • Changes tested as described above
  • Added appropriate documentation for the change.
  • Created GitHub issues for any relevant followup/future enhancements if appropriate.

@dmohns dmohns requested a review from beesaferoot March 17, 2026 18:08
Copy link
Copy Markdown
Contributor

@beesaferoot beesaferoot left a comment

Choose a reason for hiding this comment

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

Nice! This will be useful as an API deference. I left some minor comments

Comment thread src/backend/config/scribe.php Outdated
Comment on lines +58 to +63

- name: Wait for MySQL to be ready
run: |
while ! mysqladmin ping -h"127.0.0.1" -P3306 -u root -pwF9zLp2qRxaS2e --silent; do
sleep 1
done
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.

I'm curious why we need an elaborate db setup like this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Scribe has a lot of different ways to gather information about the API's. It can get this information from PHPDoc, reponsefiles or even types in some cases. Most of our routes do not have any of these. As a fallback, scribe will simply call the endpoint and use the response it gets.

To use this, we basically have to run php artisan scribe:generate in a demo setup.

Comment thread src/backend/app/Providers/AppServiceProvider.php Outdated
@dmohns dmohns requested a review from beesaferoot March 23, 2026 17:31
Copy link
Copy Markdown
Contributor

@beesaferoot beesaferoot left a comment

Choose a reason for hiding this comment

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

This looks great. Already seeing how this make things easier to segment on the docs for subsequent PR.


// Any extra authentication-related info for your users. Markdown and HTML are supported.
'extra_info' => 'You can retrieve your token by visiting your dashboard and clicking <b>Generate API token</b>.',
'extra_info' => 'This endpoint **requires authentication**. MicroPowerManager supported different auth mechanism, for example `User` login, `Agent App` login or `API Key`. Please refer to the endpoints documentation to see which applies.',
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.

MicroPowerManager supported different typo here i believe you meant MicroPowerManager supports different

@dmohns dmohns mentioned this pull request Mar 24, 2026
4 tasks
@dmohns
Copy link
Copy Markdown
Member Author

dmohns commented Mar 25, 2026

Superseded by: #1398

@dmohns dmohns closed this Mar 25, 2026
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