feat: add Scalar API explorer and OpenAPI export tooling#6
Open
alexandrewavelet wants to merge 2 commits into
Open
feat: add Scalar API explorer and OpenAPI export tooling#6alexandrewavelet wants to merge 2 commits into
alexandrewavelet wants to merge 2 commits into
Conversation
- Integrate Scalar UI as the API documentation explorer at /api/docs - Add OpenApiFactory decorator to inject app info and disable AI agent - Add pre-commit hook and Makefile target to export docs/openapi.json - Document install-hooks step in install guide Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment on lines
+1
to
+16
| #!/bin/sh | ||
| # Regenerate OpenAPI spec before each commit so docs/openapi.json stays in sync. | ||
| # Skips gracefully if Docker is not running. | ||
|
|
||
| OPENAPI_OUTPUT="docs/openapi.json" | ||
|
|
||
| if ! docker compose ps --services --filter "status=running" 2>/dev/null | grep -q "php"; then | ||
| echo "⚠ Docker php container not running — skipping OpenAPI export (run 'make openapi' manually)" | ||
| exit 0 | ||
| fi | ||
|
|
||
| echo "→ Exporting OpenAPI spec…" | ||
| docker compose exec -T php php bin/console api:openapi:export --output="$OPENAPI_OUTPUT" --no-interaction | ||
|
|
||
| git add "$OPENAPI_OUTPUT" | ||
| echo "✓ $OPENAPI_OUTPUT updated and staged" |
Collaborator
Author
There was a problem hiding this comment.
Le seul but de générer docs/openapi.json est d'avoir la spec OpenAPI à portée de main pour importer dans Postman ou pour Claude par exemple. Est ce que je garde ça?
| enable_re_doc: false | ||
| enable_scalar: true | ||
| openapi: | ||
| scalar_extra_configuration: |
Collaborator
Author
There was a problem hiding this comment.
Actuellement le "try it out" sur les endpoints est activé en prod (mais nécessite un token à saisir pour fonctionner), est ce qu'on garde ça ou en prod on utilise Scalar que pour la doc?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/api/docsOpenApiFactorydecorator to inject app name/version and disable the AI agent in the dev UImake openapitarget to keepdocs/openapi.jsonin sync automaticallymake install-hooksstep in the install guideTest plan
make install-hooksand verify the pre-commit hook is active/api/docsand confirm Scalar loads with the correct app infodocs/openapi.jsonis auto-updated and staged🤖 Generated with Claude Code