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

Add support for Swagger UI #54

Open
GheorgheBalan89 opened this issue Oct 23, 2023 · 2 comments
Open

Add support for Swagger UI #54

GheorgheBalan89 opened this issue Oct 23, 2023 · 2 comments

Comments

@GheorgheBalan89
Copy link

Swagger UI is a free library used for API documentation.
The use of it is so wide spread it can be considered industry standard.
In C# the library is available as a nuget package that can be installed and configured for each individual project.
https://learn.microsoft.com/en-us/aspnet/core/tutorials/web-api-help-pages-using-swagger?view=aspnetcore-7.0
It would be nice if this was available in Jarvis as well, preferably by default.

@rikedyp
Copy link
Contributor

rikedyp commented Nov 6, 2023

Hi Gheorghe,

We'd like to better understand what you envision with Jarvis and SwaggerUI. From what we can tell, it seems the steps are:
• Define an API using OpenAPI in a json or yaml file.
• Make it viewable using SwaggerUI as a set of HTML/CSS/JavaScript files.
• Enable Jarvis to serve that content up through its HTML interface.
It would still be up to the developer to write all the code in Jarvis to actually service the requests.

Is that along the lines of what you were envisioning? Or did you have something else in mind?

If that's what you had envisioned, then I think we just need to enable the HTML interface in REST mode. In fact, it wouldn't matter whether the content was generated by SwaggerUI or any other tool as Jarvis doesn't need any special knowledge of the source of the HTML/CSS/JS.

@GheorgheBalan89
Copy link
Author

I think that would definitely be a possible solution.
The outcome would be to use the SwaggerUI interface as a test tool while developing an APL based webservice in Jarvis.

  • as a developer I would expect to write all the code pertaining to the request/response cycle
  • the swagger interface would update dynamically as I make changes to the signature of an endpoint exposed via swagger
  • ideally there would be a simple way to toggle the swagger interface depending on the type of environment the api is running in (it should never be turned on in a production environment) - it could be achieved via an environment variable or via a config file.

Overall I think we are aligned about the outcome - but do let me know if anything is unclear.

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

No branches or pull requests

2 participants