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

Use Swagger documentation for Frigate HTTP API #14178

Merged
merged 16 commits into from
Oct 7, 2024

Conversation

iursevla
Copy link
Contributor

@iursevla iursevla commented Oct 6, 2024

Proposed change

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • The code has been formatted using Ruff (ruff format frigate)

Changes

Details

1

image

2

image

3

image
converted_file.mp4

Extra information

In the upcoming PRs, I will:

  1. Update documentation for each endpoint and re-generate the swagger file to update the HTTP API
    • Add more types
    • Add more information for each field that needs/requires it
    • etc
  2. Add tests for the HTTP API endpoints (most of them) and update the documentation accordingly
  3. Add automation to generate the swagger file on Github actions so that we don't need to generate it manually ( ⚠️ as per Use Swagger documentation for Frigate HTTP API #14178 (comment) I won't do it for now)
  4. POC for the front end using client generated from the OpenAPI specification (using OpenAPITS or OpenAPI Generator)

Copy link

netlify bot commented Oct 6, 2024

Deploy Preview for frigate-docs ready!

Name Link
🔨 Latest commit 71d0987
🔍 Latest deploy log https://app.netlify.com/sites/frigate-docs/deploys/6703e212c31b250008614ecc
😎 Deploy Preview https://deploy-preview-14178--frigate-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

docs/docusaurus.config.ts Outdated Show resolved Hide resolved
@NickM-27
Copy link
Sponsor Collaborator

NickM-27 commented Oct 6, 2024

Add automation to generate the swagger file on Github actions so that we don't need to generate it manually

I'd wait on this, we might be moving the docs site at some point so manual generation should be fine for now.

@iursevla iursevla marked this pull request as ready for review October 6, 2024 20:47
@NickM-27
Copy link
Sponsor Collaborator

NickM-27 commented Oct 6, 2024

is there a reason there is an introduction page but nothing actually on there?

@iursevla
Copy link
Contributor Author

iursevla commented Oct 7, 2024

is there a reason there is an introduction page but nothing actually on there?

@NickM-27 the docusaurus plugin for OpenAPI adds this Introduction page if there's a title or description in the OpenAPI YAML file. I can remove it OR add a more complex description

PR: https://github.com/blakeblackshear/frigate/pull/14178/files#diff-e496e6725f149db923196a05d75b2be1c528079e60ccafb25ea266b40f6ea146R3
Plugin: https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/blob/4e771d309f6defe395449b26cc3c65814d72cbcc/packages/docusaurus-plugin-openapi-docs/src/openapi/openapi.ts#L92-L129

image

If there's no description/title then it will look like this: (No Introduction page)

image

@NickM-27
Copy link
Sponsor Collaborator

NickM-27 commented Oct 7, 2024

I think no introduction page is better

@iursevla
Copy link
Contributor Author

iursevla commented Oct 7, 2024

Done @NickM-27. Please review the updated deployment: https://deploy-preview-14178--frigate-docs.netlify.app/

@NickM-27 NickM-27 merged commit 757150d into blakeblackshear:dev Oct 7, 2024
10 checks passed
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.

3 participants