ANIALLATOR114 / SimplyTransport

SimplyTransport - API - Website - Ingesting and presenting Transport Information
https://simplytransport.ie
Apache License 2.0
2 stars 3 forks source link

Update documentation #145

Closed ANIALLATOR114 closed 3 days ago

ANIALLATOR114 commented 3 days ago

Summary by Sourcery

Enhance the OpenAPI documentation by adding multiple render plugins and updating the API documentation page. Introduce a new OpenTelemetry plugin for improved observability and refactor the application to use it. Add examples for order by parameters and implement integration tests to verify documentation endpoints.

New Features:

Enhancements:

Documentation:

Tests:

sourcery-ai[bot] commented 3 days ago

Reviewer's Guide by Sourcery

This pull request updates the documentation and makes several improvements to the OpenAPI configuration, parameter handling, and OpenTelemetry integration in the SimplyTransport project. The changes include updating the OpenAPI configuration, refactoring parameter examples, modifying the app configuration, adding a new API documentation viewer, updating the OpenTelemetry setup, and adding integration tests for the documentation endpoints.

Sequence Diagram

sequenceDiagram
    participant App
    participant OpenAPIConfig
    participant RenderPlugins
    App->>OpenAPIConfig: Request configuration
    OpenAPIConfig->>RenderPlugins: Create render plugins with favicon
    RenderPlugins-->>OpenAPIConfig: Return render plugins
    OpenAPIConfig-->>App: Return updated configuration

File-Level Changes

Change Details Files
Update OpenAPI configuration
  • Replace custom OpenAPIController with render_plugins
  • Add favicon to render plugins
  • Change openapi_controller to path in custom_open_api_config
  • Set create_examples to False
SimplyTransport/lib/openapi/openapiconfig.py
Refactor parameter examples
  • Create a new file for example definitions
  • Update orderby_shapes to use the new example definitions
SimplyTransport/lib/parameters/orderby_shapes.py
SimplyTransport/lib/parameters/examples.py
Modify app configuration
  • Replace middleware with OpenTelemetryPlugin
  • Remove open_telemetry_config import
  • Add open_telemetry_plugin to the plugins list
SimplyTransport/app.py
Add Scalar API documentation viewer
  • Add a new link for Scalar documentation in the API docs template
SimplyTransport/templates/api_docs.html
Update OpenTelemetry setup
  • Create OpenTelemetryPlugin instance
SimplyTransport/lib/opentelemetry.py
Add integration tests for documentation endpoints
  • Create test cases for various documentation URLs
  • Add a test to ensure the default documentation is Stoplight
tests/integration/test_website_docs_200s.py

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).