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

Swagger integration #251

Merged
merged 6 commits into from
Oct 10, 2024
Merged

Swagger integration #251

merged 6 commits into from
Oct 10, 2024

Conversation

rajaneeshk90
Copy link
Collaborator

Summary:

This Pull Request integrates Swagger UI into the repository to host and provide an interactive visualization of the Beckn-ONIX specification. With this integration, users will be able to explore and interact with the OpenAPI specification of Beckn-ONIX directly from the GitHub repository through a web interface.

This PR utilises Swagger UI for this integration, which simplifies the exploration of API documentation and provides an intuitive user interface for testing endpoints.

Integration Details:

The following steps were taken to integrate Swagger UI into the repository:

  1. Clone Swagger UI: The Swagger UI repository was cloned locally to add it as a part of the project. git clone https://github.com/swagger-api/swagger-ui.git
  2. Copy the Swagger UI files: Content of the /dist folder from the Swagger UI repository were copied into /swagger directory inside this beckn-onix repository to serve the documentation.
  3. Link the Beckn-ONIX OpenAPI Specification: The OpenAPI specification file (specification/specification.yaml ) was linked to the Swagger UI configuration in swagger-initializer.js to render the API documentation.
  4. Hosting the Swagger UI: Since Swagger UI serves files only from /doc or / folder, we added an index.html file at the root of the repository to redirect the requests to the swagger/index.html.
  5. Merge the change: Merge the above changes in the repository (We can merge it in any branch)
  6. Change the settings in the repository: Go to your GitHub repository.
  • Click on Settings.
  • Scroll down to the GitHub Pages section.
  • Under Source, select the branch where you uploaded the dist folder (usually main or master), and choose /root as the directory.
  1. Test and Verify: GitHub Pages will now serve your static files. Your Swagger UI will be available at https://<your-username>.github.io/<your-repository-name>/

Benefits:

  1. Provides an interactive interface for exploring and testing Beckn-ONIX APIs.
  2. Simplifies onboarding for developers by enabling them to view API documentation within the repository.
  3. Encourages consistent use of OpenAPI standards by hosting the spec in a format that is accessible and usable.

@rajaneeshk90 rajaneeshk90 merged commit e93861f into main Oct 10, 2024
3 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.

1 participant