Issue #168: OpenAPI documentation
Note
- calling
$this->created();from all entities because Psalm complained about$this->creatednot being initialized from anywhere - role(s) must be set when super/admin creates a user (instead of assigning default
userrole as before) - when users register their account, default roleuseris automatically assigned, as before - prevented MySQL error thrown on getCollection routes if sortBy field's value does not exist as a column in the database
Usage
Default:
vendor/bin/openapi src
Specify output file path:
vendor/bin/openapi src -o public/openapi.yaml
Specify OpenAPI version (default is 3.0.0):
vendor/bin/openapi src -o public/openapi.yaml --version 3.1.0
Qodana for PHP
It seems all right 👌
No new problems were found according to the checks applied
💡 Qodana analysis was run in the pull request mode: only the changed files were checked ☁️ View the detailed Qodana report
Detected 111 dependencies
Third-party software list
This page lists the third-party software dependencies used in project
Contact Qodana team
Contact us at [email protected]
- Or via our issue tracker: https://jb.gg/qodana-issue
- Or share your feedback: https://jb.gg/qodana-discussions
@alexmerlin From me, just a little sugestion.
The UI for this is just a small step, you could make the file to be generated in public/docs/openapi.yaml and with this an additional index.html to be installed or already be presend there
the content of index.html would be this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Dotkernel Documentation" />
<title>Dotkernel API DOCS</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/swagger-ui.css" />
</head>
<body>
<div id="swagger-ui"></div>
<script src="https://unpkg.com/[email protected]/swagger-ui-bundle.js" crossorigin></script>
<script>
window.onload = () => {
window.ui = SwaggerUIBundle({
url: 'openapi.yaml',
dom_id: '#swagger-ui',
});
};
</script>
</body>
</html>
You can leave the assets to be served from cdn or import them to be served from the docs folder