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(swagger): use swagger-ui-express to display simple and administration api doc #85

Merged
merged 6 commits into from
Jul 21, 2023

Conversation

jmkerloch
Copy link
Contributor

@jmkerloch jmkerloch commented Jun 30, 2023

  • add api documentation in docker image
  • convert api documentation in yaml to json
  • serve swagger-ui with swagger-ui-express

Simple and administration openapi are available.

related #84

- add api documentation in docker image
- convert yaml to josn with YAML node module
- serve swagger-ui with swagger-ui-express
@jmkerloch jmkerloch added the enhancement New feature or request label Jun 30, 2023
@jmkerloch jmkerloch self-assigned this Jun 30, 2023
@jmkerloch jmkerloch requested review from lgrd and azarz June 30, 2023 12:54
@azarz
Copy link
Member

azarz commented Jul 3, 2023

I personally think that's a great way to display the API documentation.
I will wait for @lgrd 's return to approve the PR.

azarz
azarz previously approved these changes Jul 18, 2023
Copy link
Collaborator

@lgrd lgrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
Thank you for this idea. I think it is a good way to complete the getcapabilities.

May I suggest you a few more steps for this feature ?

  • convert the YAMLs to JSONs, so it will avoid one dependency.
  • read the new JSONs during the init step of the each API (we can talk about this if you want ;) )
  • serve those new pages on /{api}/1.0.0/openapi.
  • create the page for the admin API too, so the project will be completely available for humans.
  • update the changelog

@jmkerloch
Copy link
Contributor Author

convert the YAMLs to JSONs, so it will avoid one dependency.

You mean replacing api.yaml to api.json ?

read the new JSONs during the init step of the each API

If the API is described with JSON file we can just use this file directly for swagger-ui-express:

var swaggerDocument = require('./api.json');
router.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument));

@lgrd
Copy link
Collaborator

lgrd commented Jul 19, 2023

@jmkerloch Yes, I think we could replace it. I've seen it could be a JSON => https://spec.openapis.org/oas/latest.html#format

For the init step, you have a init file where you can do what you need to prepare your data.

@jmkerloch jmkerloch changed the title feat(swagger): use swagger-ui-express to display simple api doc feat(swagger): use swagger-ui-express to display simple and administration api doc Jul 21, 2023
Copy link
Collaborator

@lgrd lgrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's ok for me :)

@lgrd lgrd merged commit 1a19d49 into develop Jul 21, 2023
3 checks passed
@lgrd lgrd deleted the feature/add_swagger_ui branch July 21, 2023 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants