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

NOISSUE - Use github action for showing OpenAPI spec with Swagger UI #1427

Merged
merged 20 commits into from
Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy GitHub Pages

on:
push:
branches:
- master

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Swagger ui action
id: swagger-ui-action
uses: pjoc-team/swagger-ui-action@v0.0.2
with:
dir: './api'
pattern: '*.yml'
debug: 'true'
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: swagger-ui
cname: api.mainflux.io
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Check that `.env` file contains:
MF_RELEASE_TAG=<release_number>
```

>`docker-compose` should be used for development and testing deployments. For production we suggest using [Kubernetes](https://mainflux.readthedocs.io/en/latest/kubernetes/).
>`docker-compose` should be used for development and testing deployments. For production we suggest using [Kubernetes](https://docs.mainflux.io/kubernetes.html).

## Usage

Expand All @@ -87,7 +87,7 @@ make cli
./build/mainflux-cli version
```

Additional details on using the CLI can be found in the [CLI documentation](https://mainflux.readthedocs.io/en/latest/cli/).
Additional details on using the CLI can be found in the [CLI documentation](https://docs.mainflux.io/cli.html).

## Documentation

Expand Down
5 changes: 5 additions & 0 deletions api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Mainflux OpenAPI Specification

This folder contains an OpenAPI specifications for Mainflux API.

View specification in Swagger UI at [api.mainflux.io](https://api.mainflux.io)
9 changes: 0 additions & 9 deletions auth/openapi.yml → api/auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ paths:
Array of member ids that are in the group specified with groupID.
parameters:
- $ref: "#/components/parameters/Authorization"
- $ref: "#/components/parameters/MemberType"
- $ref: "#/components/parameters/GroupId"
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/Limit"
Expand Down Expand Up @@ -479,14 +478,6 @@ components:
type: string
format: uuid | ulid
required: true
MemberType:
name: type
description: Member type association.
in: path
schema:
type: string
enum: [users, things]
required: true
Limit:
name: limit
description: Size of the subset to retrieve.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ If `MF_EMAIL_TEMPLATE` doesn't point to any file service will function but passw
## Usage

For more information about service capabilities and its usage, please check out
the [API documentation](openapi.yml).
the [API documentation](https://api.mainflux.io/?urls.primaryName=auth-openapi.yml).
Copy link
Contributor

@manuio manuio Jun 23, 2021

Choose a reason for hiding this comment

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

Why this url? It should be api/auth-openapi.yml, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes @manuio , raw yml file is there. But on api.mainflux.io domain, it will be shown in SwaggerUI which is more user friendly


[doc]: http://mainflux.readthedocs.io
[doc]: https://docs.mainflux.io
4 changes: 2 additions & 2 deletions bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,6 @@ Setting `MF_BOOTSTRAP_CA_CERTS` expects a file in PEM format of trusted CAs. Thi
## Usage

For more information about service capabilities and its usage, please check out
the [API documentation](openapi.yml).
the [API documentation](https://api.mainflux.io/?urls.primaryName=bootstrap-openapi.yml).

[doc]: http://mainflux.readthedocs.io
[doc]: https://docs.mainflux.io
5 changes: 4 additions & 1 deletion consumers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ run consumer services, core services must be up and running.
For an in-depth explanation of the usage of `consumers`, as well as thorough
understanding of Mainflux, please check out the [official documentation][doc].

[doc]: http://mainflux.readthedocs.io
For more information about service capabilities and its usage, please check out
the [API documentation](https://api.mainflux.io/?urls.primaryName=consumers-notifiers-openapi.yml).

[doc]: https://docs.mainflux.io
2 changes: 1 addition & 1 deletion consumers/notifiers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ default values.

Subscriptions service will start consuming messages and sending notifications when a message is received.

[doc]: http://mainflux.readthedocs.io
[doc]: https://docs.mainflux.io
2 changes: 1 addition & 1 deletion consumers/notifiers/smtp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ default values.

Starting service will start consuming messages and sending emails when a message is received.

[doc]: http://mainflux.readthedocs.io
[doc]: https://docs.mainflux.io
2 changes: 1 addition & 1 deletion consumers/writers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ the [Docker Compose][compose] file.
For an in-depth explanation of the usage of `writers`, as well as thorough
understanding of Mainflux, please check out the [official documentation][doc].

[doc]: http://mainflux.readthedocs.io
[doc]: https://docs.mainflux.io
[compose]: ../docker/docker-compose.yml
2 changes: 1 addition & 1 deletion consumers/writers/cassandra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ execute following command:

Starting service will start consuming normalized messages in SenML format.

[doc]: http://mainflux.readthedocs.io
[doc]: https://docs.mainflux.io
2 changes: 1 addition & 1 deletion consumers/writers/influxdb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ _Please note that you need to start core services before the additional ones._

Starting service will start consuming normalized messages in SenML format.

[doc]: http://mainflux.readthedocs.io
[doc]: https://docs.mainflux.io
4 changes: 3 additions & 1 deletion http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ Setting `MF_HTTP_ADAPTER_CA_CERTS` expects a file in PEM format of trusted CAs.
## Usage

For more information about service capabilities and its usage, please check out
the [API documentation](openapi.yml).
the [API documentation](https://api.mainflux.io/?urls.primaryName=http-openapi.yml).

[doc]: https://docs.mainflux.io
2 changes: 1 addition & 1 deletion lora/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ docker-compose -f docker/addons/lora-adapter/docker-compose.yml up -d
## Usage

For more information about service capabilities and its usage, please check out
the [Mainflux documentation](https://mainflux.readthedocs.io/en/latest/lora/).
the [Mainflux documentation](https://docs.mainflux.io/lora.html).
2 changes: 1 addition & 1 deletion opcua/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ docker-compose -f docker/addons/opcua-adapter/docker-compose.yml up -d
## Usage

For more information about service capabilities and its usage, please check out
the [Mainflux documentation](https://mainflux.readthedocs.io/en/latest/opcua/).
the [Mainflux documentation](https://docs.mainflux.io/opcua.html).
2 changes: 1 addition & 1 deletion readers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Mainflux messages from data storage and opens HTTP API for message consumption.
For an in-depth explanation of the usage of `reader`, as well as thorough
understanding of Mainflux, please check out the [official documentation][doc].

[doc]: http://mainflux.readthedocs.io
[doc]: https://docs.mainflux.io
4 changes: 2 additions & 2 deletions readers/cassandra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ docker-compose -f docker/addons/casandra-reader/docker-compose.yml up -d

## Usage

Service exposes [HTTP API][doc] for fetching messages.
Service exposes [HTTP API](https://api.mainflux.io/?urls.primaryName=readers-openapi.yml) for fetching messages.

[doc]: ../openapi.yml
[doc]: https://docs.mainflux.io
4 changes: 2 additions & 2 deletions readers/influxdb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ docker-compose -f docker/addons/influxdb-reader/docker-compose.yml up -d

## Usage

Service exposes [HTTP API][doc] for fetching messages.
Service exposes [HTTP API](https://api.mainflux.io/?urls.primaryName=readers-openapi.yml) for fetching messages.

[doc]: ../openapi.yml
[doc]: https://docs.mainflux.io
4 changes: 2 additions & 2 deletions readers/mongodb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ docker-compose -f docker/addons/mongodb-reader/docker-compose.yml up -d

## Usage

Service exposes [HTTP API][doc] for fetching messages.
Service exposes [HTTP API](https://api.mainflux.io/?urls.primaryName=readers-openapi.yml) for fetching messages.

[doc]: ../openapi.yml
[doc]: https://docs.mainflux.io
4 changes: 2 additions & 2 deletions things/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@ Setting `MF_THINGS_CA_CERTS` expects a file in PEM format of trusted CAs. This w
## Usage

For more information about service capabilities and its usage, please check out
the [API documentation](openapi.yml).
the [API documentation](https://api.mainflux.io/?urls.primaryName=things-openapi.yml).

[doc]: http://mainflux.readthedocs.io
[doc]: https://docs.mainflux.io
2 changes: 1 addition & 1 deletion tools/mqtt-bench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The tool supports multiple concurrent clients, publishers and subscribers config
```
./mqtt-bench --help
Tool for extensive load and benchmarking of MQTT brokers used within Mainflux platform.
Complete documentation is available at https://mainflux.readthedocs.io
Complete documentation is available at https://docs.mainflux.io

Usage:
mqtt-bench [flags]
Expand Down
2 changes: 1 addition & 1 deletion tools/mqtt-bench/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func main() {
Use: "mqtt-bench",
Short: "mqtt-bench is MQTT benchmark tool for Mainflux",
Long: `Tool for exctensive load and benchmarking of MQTT brokers used withing Mainflux platform.
Complete documentation is available at https://mainflux.readthedocs.io`,
Complete documentation is available at https://docs.mainflux.io`,
Run: func(cmd *cobra.Command, args []string) {
if confFile != "" {
viper.SetConfigFile(confFile)
Expand Down
2 changes: 1 addition & 1 deletion tools/provision/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ that can be used by Mainflux MQTT benchmarking tool (`mqtt-bench`).
```
./provision --help
Tool for provisioning series of Mainflux channels and things and connecting them together.
Complete documentation is available at https://mainflux.readthedocs.io
Complete documentation is available at https://docs.mainflux.io

Usage:
provision [flags]
Expand Down
2 changes: 1 addition & 1 deletion tools/provision/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func main() {
Use: "provision",
Short: "provision is provisioning tool for Mainflux",
Long: `Tool for provisioning series of Mainflux channels and things and connecting them together.
Complete documentation is available at https://mainflux.readthedocs.io`,
Complete documentation is available at https://docs.mainflux.io`,
Run: func(cmd *cobra.Command, args []string) {
provision.Provision(pconf)
},
Expand Down
4 changes: 2 additions & 2 deletions twins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,6 @@ mainflux natively, than do the same thing in the corresponding console
environment.

For more information about service capabilities and its usage, please check out
the [API documentation](openapi.yml).
the [API documentation](https://api.mainflux.io/?urls.primaryName=twins-openapi.yml).

[doc]: http://mainflux.readthedocs.io
[doc]: https://docs.mainflux.io
4 changes: 2 additions & 2 deletions users/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ If `MF_EMAIL_TEMPLATE` doesn't point to any file service will function but passw
## Usage

For more information about service capabilities and its usage, please check out
the [API documentation](openapi.yml).
the [API documentation](https://api.mainflux.io/?urls.primaryName=users-openapi.yml).

[doc]: http://mainflux.readthedocs.io
[doc]: https://docs.mainflux.io