Add Utility support for swagger UI documentation for REST endpoints #3600
Open
shivanshtalwar0 wants to merge 1 commit intomeetecho:masterfrom
Open
Add Utility support for swagger UI documentation for REST endpoints #3600shivanshtalwar0 wants to merge 1 commit intomeetecho:masterfrom
shivanshtalwar0 wants to merge 1 commit intomeetecho:masterfrom
Conversation
|
Thanks for your contribution, @shivanshtalwar0! Please make sure you sign our CLA, as it's a required step before we can merge this. |
Member
|
I don't know why Copilot thought it could automatically start a review here. I never enabled it, never allowed it to touch my repo and I don't want it to even look at my repo, let alone have a say about it. I think I've disabled it now, but I'll have to see if it will appear again. That said, while your contribution looks cool, I don't think it belongs in the repo here. This sounds more like something that could be a repo of its own, for people insterested in an OpenAPI document. I certainly don't want to mantain yet another piece of Python code, especially considering I'm not proficient in Python at all. |
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.
Janus Gateway Tools
This directory contains helper utilities for generating and maintaining Janus Gateway documentation.
generate_swagger.pygenerate_swagger.pyinspectssrc/janus.cand produces an OpenAPI document that describes both the public/janusAPI and the administrative/adminAPI. The script can also serve the specification through an embedded Swagger UI for quick local exploration.Prerequisites
From the repository root, run the script with
python3 tools/generate_swagger.py.Common workflows
Generate the specification file
Writes the rendered OpenAPI document to
docs/swagger.json.Print the specification to stdout
Useful for piping the output to other tooling.
Check whether
docs/swagger.jsonis up to dateExits with status
0when the existing file matches the generated output, otherwise exits with1. Handy for CI jobs that enforce documentation freshness.Serve the spec with Swagger UI
Starts a local development server at
http://127.0.0.1:8000/(configurable with--hostand--port). The UI automatically fetches the freshly generated specification. Combine with--no-writeto avoid touchingdocs/swagger.jsonduring ad-hoc previews.Additional options
--source: path tojanus.crelative to the repository root (defaults tosrc/janus.c).--output: destination path for the generated OpenAPI document (defaults todocs/swagger.json).--no-write: skip writing the output file, typically paired with--serve.Run
python3 tools/generate_swagger.py --helpto see the full list of supported flags.