https://github.com/optum/faas-swagger
Swagger for Openfaas
https://github.com/optum/faas-swagger
openfaas serverless swagger swagger-ui
Last synced: 6 months ago
JSON representation
Swagger for Openfaas
- Host: GitHub
- URL: https://github.com/optum/faas-swagger
- Owner: Optum
- License: apache-2.0
- Created: 2019-12-03T21:19:12.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-05-19T17:01:46.000Z (over 4 years ago)
- Last Synced: 2025-04-14T15:22:01.159Z (6 months ago)
- Topics: openfaas, serverless, swagger, swagger-ui
- Language: Go
- Homepage:
- Size: 13.1 MB
- Stars: 18
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: docs/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: docs/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Swagger for Openfaas
[](https://goreportcard.com/badge/github.com/optum/faas-swagger)
[](https://pkg.go.dev/github.com/optum/faas-swagger)
[](https://github.com/optum/faas-swagger/blob/master/LICENSE)Swagger interface for openfaas functions
### Whats it About
* Document your Openfaas functions in OpenAPI 3.0 Spec and visualize it in a swagger ui.
* Uses the annotations in the function descriptor yml to look for the swagger config.
* Test functions from swagger ui----------------

----------------
### Function
Navigate to the [function](./function) folder to deploy the swagger yaml generator.
-----------------
### UI
The function will generate the swagger yaml. To visualize, deploy the swaggerui-proxy component as below
```
ko apply -RBf config/
```Once the component is created access the ui at `/swaggerui/` path.
------------------
### Usage
Add your api spec (json format) in the function descriptor(stack.yaml) as annotation. Use this [example](./lib/test/test-files/example/example.yaml).
After deploying your function with this annotation, you should be able see the paths in swagger ui
* We are following open api 3.0 spec
* Please make sure the json is well formatted.
* In swagger 3.0, the spec is defined in yaml. You can define in yaml and convert to json using online editor like [this](https://codebeautify.org/yaml-to-json-xml-csv)
* If annotatation is not provided , by default just the path will be shown.---------
### Authentication
Supports the basic auth plugin.
Implement the [OFAuth](./pkg/auth/auth.go) interface for other options
-----------------
### GO Packages
The [swagger](./pkg/swagger) package can be used as a standalone in your GO function.
----------
### Contributing to the Project
The team is open to contributions to our project. For more details, see our [Contribution Guide.](./docs/CONTRIBUTING.md)