1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-05-12 19:29:30 +08:00
Ian Ngethe Muchiri 7948aa72e8
MF-1761 - Improve path parameters naming (#1762)
* Improve path parameters naming

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* Improve path parameter naming

improve path parameter naming for:
   bootstrap/api/transport.go
   twins/api/http/transport.go

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* Change functions to suit updated path params

Duplicated the functions decodeView and decodeListByConnection to
form new functions decodeThingView, decodeChannelView,
decodeThingListByConnection and decodeChannelListByConnection. This
was as a result of the two functions being used for both view thing
and view channel services

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* Improve path parameter naming

Improve path parameter naming for:
    auth/api/http/groups/transport.go
    bootstrap/api/transport.go
    twins/api/http/transport.go
    ws/api/endpoints.go

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* fix swagger files

Updated the following swagger files
    api/openapi/auth.yml
    api/openapi/cert.yml
    api/openapi/websocket.yml

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* Move websocket.yml from openapi to asyncapi

deleted websocket.yml file in openapi and created websocket.yml file
in asyncapi

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* Update websocket.yml file

Update the websocket.yml file to make subtopic optional and
added security (bearerAuth)

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* Format new line correctly

format newline for api/asyncapi/websocket.yml

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* update websocket.yml file

update the websocket.yml file based on the requested review changes
    The document is now valid

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* Update path parameter naming

make changes to path parameter naming in:
    api/openapi/consumers-notifiers.yml

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* update path parameters naming

Update path parameters naming to be consistent with Go

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* update the mqtt.yml file

update the mqtt.yml file to the latest AsyncAPI version and
make changes on the security of the server

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* Add contact information

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* Update api/asyncapi/mqtt.yml

Co-authored-by: b1ackd0t <blackd0t@protonmail.com>
Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

* Add an empty line between functions

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>

---------

Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
Co-authored-by: b1ackd0t <blackd0t@protonmail.com>
Co-authored-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
2023-04-20 21:53:02 +02:00

242 lines
6.3 KiB
YAML

openapi: 3.0.1
info:
title: Mainflux reader service
description: HTTP API for reading messages.
version: "1.0.0"
paths:
/channels/{chanID}/messages:
get:
summary: Retrieves messages sent to single channel
description: |
Retrieves a list of messages sent to specific channel. Due to
performance concerns, data is retrieved in subsets. The API readers must
ensure that the entire dataset is consumed either by making subsequent
requests, or by increasing the subset size of the initial request.
tags:
- messages
parameters:
- $ref: "#/components/parameters/ChanId"
- $ref: "#/components/parameters/Limit"
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/Publisher"
- $ref: "#/components/parameters/Name"
- $ref: "#/components/parameters/Value"
- $ref: "#/components/parameters/BoolValue"
- $ref: "#/components/parameters/StringValue"
- $ref: "#/components/parameters/DataValue"
- $ref: "#/components/parameters/From"
- $ref: "#/components/parameters/To"
responses:
'200':
$ref: "#/components/responses/MessagesPageRes"
'400':
description: Failed due to malformed query parameters.
'401':
description: Missing or invalid access token provided.
'500':
$ref: "#/components/responses/ServiceError"
/health:
get:
summary: Retrieves service health check info.
tags:
- health
responses:
'200':
$ref: "#/components/responses/HealthRes"
'500':
$ref: "#/components/responses/ServiceError"
components:
schemas:
MessagesPage:
type: object
properties:
total:
type: number
description: Total number of items that are present on the system.
offset:
type: number
description: Number of items that were skipped during retrieval.
limit:
type: number
description: Size of the subset that was retrieved.
messages:
type: array
minItems: 0
uniqueItems: true
items:
type: object
properties:
channel:
type: integer
description: Unique channel id.
publisher:
type: integer
description: Unique publisher id.
protocol:
type: string
description: Protocol name.
name:
type: string
description: Measured parameter name.
unit:
type: string
description: Value unit.
value:
type: number
description: Measured value in number.
stringValue:
type: string
description: Measured value in string format.
boolValue:
type: boolean
description: Measured value in boolean format.
dataValue:
type: string
description: Measured value in binary format.
valueSum:
type: number
description: Sum value.
time:
type: number
description: Time of measurement.
updateTime:
type: number
description: Time of updating measurement.
parameters:
ChanId:
name: chanID
description: Unique channel identifier.
in: path
schema:
type: string
format: uuid
required: true
Limit:
name: limit
description: Size of the subset to retrieve.
in: query
schema:
type: integer
default: 10
maximum: 100
minimum: 1
required: false
Offset:
name: offset
description: Number of items to skip during retrieval.
in: query
schema:
type: integer
default: 0
minimum: 0
required: false
Publisher:
name: Publisher
description: Unique thing identifier.
in: query
schema:
type: string
format: uuid
required: false
Name:
name: name
description: SenML message name.
in: query
schema:
type: string
required: false
Value:
name: v
description: SenML message value.
in: query
schema:
type: string
required: false
BoolValue:
name: vb
description: SenML message bool value.
in: query
schema:
type: boolean
required: false
StringValue:
name: vs
description: SenML message string value.
in: query
schema:
type: string
required: false
DataValue:
name: vd
description: SenML message data value.
in: query
schema:
type: string
required: false
Comparator:
name: comparator
description: Value comparison operator.
in: query
schema:
type: string
default: eq
enum:
- eq
- lt
- le
- gt
- ge
required: false
From:
name: from
description: SenML message time in nanoseconds (integer part represents seconds).
in: query
schema:
type: number
required: false
To:
name: to
description: SenML message time in nanoseconds (integer part represents seconds).
in: query
schema:
type: number
required: false
responses:
MessagesPageRes:
description: Data retrieved.
content:
application/json:
schema:
$ref: "#/components/schemas/MessagesPage"
ServiceError:
description: Unexpected server-side error occurred.
HealthRes:
description: Service Health Check.
content:
application/json:
schema:
$ref: "./schemas/HealthInfo.yml"
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: |
* Users access: "Authorization: Bearer <user_token>"
thingAuth:
type: http
scheme: bearer
bearerFormat: uuid
description: |
* Things access: "Authorization: Thing <thing_key>"
security:
- bearerAuth: []
- thingAuth: []