Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/api #220

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Feat/api #220

wants to merge 6 commits into from

Conversation

cyclotruc
Copy link
Owner

WIP

atyrode and others added 6 commits March 4, 2025 18:01
Implement content negotiation to return plain text by default for API clients
while preserving HTML responses for browser requests. This improves API
usability for non-browser clients while maintaining the existing user
experience for web users.

- Add browser detection via User-Agent header
- Return PlainTextResponse for API clients
- Preserve HTML template responses for browser requests
This commit enhances the API functionality by allowing programmatic access
with customizable parameters through URL query strings. The changes include:

- Add support for max_size, pattern_type, and pattern query parameters
  in non-browser GET requests to /{repository_path}
- Create comprehensive API documentation in docs/api.md with:
  * Detailed endpoint descriptions
  * Parameter specifications
  * Response format documentation
  * Usage examples
  * Best practices
- Update API web interface (api.jinja) to reflect new capabilities
  and provide clear usage instructions

These changes enable API consumers to filter repositories by file patterns
and size limits without using the web interface, making the API more
flexible for integration with external tools and scripts.
This commit enhances the API functionality by allowing programmatic access
with JSON response format through URL query parameters or Accept headers.
The changes include:

- Add support for format parameter in non-browser GET requests
- Implement JSON response format in query processor
- Update API documentation with format options and examples
- Add comprehensive tests for format detection and response handling

This change maintains backward compatibility while providing a more
structured response format for API consumers.
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