CodeIgniter Forums
Swagger for Codeigniter 4 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: Swagger for Codeigniter 4 (/showthread.php?tid=88020)



Swagger for Codeigniter 4 - Cesar27 - 07-07-2023

Hi there! I'm looking for a package or indications on how to install Swagger on CI 4. 
Appreciate any help.


RE: Swagger for Codeigniter 4 - kenjis - 07-07-2023

Do you mean like this?
https://github.com/pandigresik/easyAPI


RE: Swagger for Codeigniter 4 - Cesar27 - 07-10-2023

(07-07-2023, 04:53 PM)kenjis Wrote: Do you mean like this?
https://github.com/pandigresik/easyAPI

Not exactly, I need to install and configure Swagger on an existing project.
EasyAPI creates a brand new project.


RE: Swagger for Codeigniter 4 - kenjis - 07-10-2023

What is Swagger?
Swagger UI?
https://swagger.io/tools/swagger-ui/

What do you want to do?


RE: Swagger for Codeigniter 4 - luckmoshy - 07-10-2023

at the this time there is no such CI and SWagger module,package or library to do in CI unless if you are good and familiarized with CI you can and create your own module to inject to your wish


RE: Swagger for Codeigniter 4 - robinncode - 11-22-2024

(07-10-2023, 04:04 PM)kenjis Wrote: What is Swagger?
Swagger UI?
https://swagger.io/tools/swagger-ui/

What do you want to do?

Yes, swagger UI. There is a package for laravel "https://packagist.org/packages/darkaonline/l5-swagger". I want the same functionality as this package with Codeigniter4.


RE: Swagger for Codeigniter 4 - robinncode - 12-16-2024

Step-by-Step Guide to Integrate Swagger with CodeIgniter 4 !!!
I’m working on an open-source package to automate this process. Feel free to share corrections or suggestions in the comments or reach me via email: [email protected]

Also, you guys can read this article at the following links:
Dev.to: https://dev.to/robinncode/integrate-swagger-ui-with-codeigniter4-47je
Hashnode: https://msmrobin.hashnode.dev/integrate-swagger-ui-with-codeigniter4


RE: Swagger for Codeigniter 4 - Ruzick - 01-02-2025

If I got you right, you need to install the necessary dependencies using composer. composer require zircote/swagger-php doctrine/annotations
```[_{{{CITATION{{{_1{Integrate Swagger UI with Codeigniter4 - DEV Community](https://dev.to/robinncode/integrate-swagger-ui-with-codeigniter4-47je)

Then download the Swagger UI files and create a new controller to generate the Swagger documentation. Next add routes to your Config/Routes.php file.

Create a view file to render the Swagger UI:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
<link rel="stylesheet" type="text/css" href="<?php echo base_url('swagger_ui/swagger-ui.css'); ?>">
<link rel="icon" type="image/png" href="<?php echo base_url('swagger_ui/favicon-32x32.png'); ?>" sizes="32x32">
<link rel="icon" type="image/png" href="<?php echo base_url('swagger_ui/favicon-16x16.png'); ?>" sizes="16x16">
</head>
<body>
<div id="swagger-ui"></div>
<script src="<?php echo base_url('swagger_ui/swagger-ui-bundle.js'); ?>"></script>
<script src="<?php echo base_url('swagger_ui/swagger-ui-standalone-preset.js'); ?>"></script>
</body>
</html>
```[_{{{CITATION{{{_1{Integrate Swagger UI with Codeigniter4 - DEV Community](https://dev.to/robinncode/integrate-swagger-ui-with-codeigniter4-47je)


and generate the Swagger UI assets

php spark swagger:assets
```[_{{{CITATION{{{_2{arbims/Swagger-ci: third party Code for generate swagger api - GitHub](https://github.com/arbims/Swagger-ci)


RE: Swagger for Codeigniter 4 - nguyenvanlongxp - 01-11-2025

Not exactly, I need to install and configure Swagger on an existing project.