Skip to content

Commit

Permalink
Merge pull request #3767 from Agnul97/fix-consistencyOpenApiDoc
Browse files Browse the repository at this point in the history
FIX - Reached consistency with enums on openApi doc files
  • Loading branch information
Coduz authored May 9, 2023
2 parents 9050987 + 858f863 commit fd877d7
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ paths:
application/json:
schema:
$ref: 'authentication.yaml#/components/schemas/usernamePasswordCredentials'
required: true
examples:
Admin:
value:
Expand All @@ -40,6 +39,7 @@ paths:
username: kapua-sys
password: kapua-password
trustKey: 4bba9938-aa8f-11ec-b909-0242ac120002
required: true
responses:
200:
description: The new AccessToken
Expand Down
64 changes: 6 additions & 58 deletions rest-api/resources/src/main/resources/openapi/device/device.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ components:
- description: The ID of the last recorded Event from this Device
readOnly: true
lastEvent:
$ref: '#/components/schemas/event'
$ref: '../deviceEvent/deviceEvent.yaml#/components/schemas/deviceEvent'
serialNumber:
description: The Serial Number of this Device
type: string
Expand Down Expand Up @@ -124,19 +124,19 @@ components:
description: The MIME Encoding accepted by this Device
type: string
customAttribute1:
description: A Custom Attirbute of this Device - 1
description: A Custom Attribute of this Device - 1
type: string
customAttribute2:
description: A Custom Attirbute of this Device - 2
description: A Custom Attribute of this Device - 2
type: string
customAttribute3:
description: A Custom Attirbute of this Device - 3
description: A Custom Attribute of this Device - 3
type: string
customAttribute4:
description: A Custom Attirbute of this Device - 4
description: A Custom Attribute of this Device - 4
type: string
customAttribute5:
description: A Custom Attirbute of this Device - 5
description: A Custom Attribute of this Device - 5
type: string
extendedProperties:
type: array
Expand Down Expand Up @@ -293,16 +293,6 @@ components:
enum:
- ENABLED
- DISABLED
action:
type: string
enum:
- READ
- CREATE
- WRITE
- DELETE
- OPTIONS
- EXECUTE
- SUBMIT
deviceExtendedProperty:
allOf:
- type: object
Expand All @@ -318,48 +308,6 @@ components:
groupName: Hardware Info
name: CPU Family
value: ARM
event:
allOf:
- $ref: '../openapi.yaml#/components/schemas/kapuaEntity'
- type: object
properties:
sentOn:
type: string
format: 'date-time'
receivedOn:
type: string
format: 'date-time'
position:
$ref: '../dataMessage/dataMessage.yaml#/components/schemas/position'
resource:
type: string
action:
$ref: '#/components/schemas/action'
responseCode:
type: string
enum:
- ACCEPTED
- SENT
- BAD_REQUEST
- NOT_FOUND
- INTERNAL_ERROR
eventMessage:
type: string
example:
id: YYHQ2i1S-P0
scopeId: AQ
createdOn: '2019-09-12T09:04:37.392Z'
createdBy: Ag
deviceId: WyczTs_GuDM
receivedOn: '2019-09-12T09:04:32.646Z'
position:
altitude: 0
latitude: 0
longitude: 0
resource: BIRTH
action: CREATE
responseCode: ACCEPTED
eventMessage: 'acceptEncoding=gzip~~applicationFramework=Kura~~applicationFrameworkVersion=ESF_6.0.0~~applicationIdentifiers=heaterPROV-V2DEPLOY-V2VPNCLIENT-V2CONF-V1CERT-V1ASSET-V1CMD-V1~~availableProcessors=4~~bios=N/A~~biosVersion=N/A~~connectionInterface=lo (00:00:00:00:00:00)~~connectionIp=127.0.0.1~~containerFramework=Eclipse~~containerFrameworkVersion=1.8.0~~displayName=~~firmware=N/A~~firmwareVersion=N/A~~jvm=Java HotSpot(TM) 64-Bit Server VM~~jvmProfile=Java(TM) SE Runtime Environment 1.8.0_161-b12~~jvmVersion=25.161-b12 mixed mode~~modelId=ESF-Docker-RHEL~~modelName=ESF-Docker-RHEL~~os=Linux~~osArch=amd64~~osVersion=4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019~~partNumber=ESF-Docker-RHEL~~serialNumber=ESF-Docker-RHEL~~totalMemory=1023488~~uptime=187894320'
fetchAttribute:
type: string
enum:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ components:
schemas:
deviceEvent:
allOf:
- $ref: '../openapi.yaml#/components/schemas/kapuaEntity'
- type: object
properties:
deviceId:
Expand All @@ -42,7 +41,7 @@ components:
resource:
type: string
action:
type: string
$ref: '../openapi.yaml#/components/schemas/action'
responseCode:
type: string
enum:
Expand All @@ -54,18 +53,20 @@ components:
eventMessage:
type: string
example:
type: deviceEvent
id: JYINy4IMGK4
id: YYHQ2i1S-P0
scopeId: AQ
createdOn: '2019-09-13T12:00:31.738Z'
createdBy: AQ
deviceId: IaIA6xbNR7E
sentOn: '2019-09-13T12:00:31.687Z'
receivedOn: '2019-09-13T12:00:31.718Z'
resource: CONFIGURATION
action: READ
createdOn: '2019-09-12T09:04:37.392Z'
createdBy: Ag
deviceId: WyczTs_GuDM
receivedOn: '2019-09-12T09:04:32.646Z'
position:
altitude: 0
latitude: 0
longitude: 0
resource: BIRTH
action: CREATE
responseCode: ACCEPTED
eventMessage:
eventMessage: 'acceptEncoding=gzip~~applicationFramework=Kura~~applicationFrameworkVersion=ESF_6.0.0~~applicationIdentifiers=heaterPROV-V2DEPLOY-V2VPNCLIENT-V2CONF-V1CERT-V1ASSET-V1CMD-V1~~availableProcessors=4~~bios=N/A~~biosVersion=N/A~~connectionInterface=lo (00:00:00:00:00:00)~~connectionIp=127.0.0.1~~containerFramework=Eclipse~~containerFrameworkVersion=1.8.0~~displayName=~~firmware=N/A~~firmwareVersion=N/A~~jvm=Java HotSpot(TM) 64-Bit Server VM~~jvmProfile=Java(TM) SE Runtime Environment 1.8.0_161-b12~~jvmVersion=25.161-b12 mixed mode~~modelId=ESF-Docker-RHEL~~modelName=ESF-Docker-RHEL~~os=Linux~~osArch=amd64~~osVersion=4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019~~partNumber=ESF-Docker-RHEL~~serialNumber=ESF-Docker-RHEL~~totalMemory=1023488~~uptime=187894320'
deviceEventListResult:
allOf:
- $ref: '../openapi.yaml#/components/schemas/kapuaListResult'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ components:
- type: object
properties:
action:
$ref: '../device/device.yaml#/components/schemas/action'
$ref: '../openapi.yaml#/components/schemas/action'
appId:
type: string
deviceId:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ components:
version:
type: string
method:
$ref: '../device/device.yaml#/components/schemas/action'
$ref: '../openapi.yaml#/components/schemas/action'
resources:
type: array
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ paths:
tags:
- Job - Trigger Fired
summary: Count the Jobs Trigger Fired
operationId: jobTriggerCount
operationId: jobTriggerFiredCount
parameters:
- $ref: '../openapi.yaml#/components/parameters/scopeId'
- $ref: '../job/job.yaml#/components/parameters/jobId'
Expand Down
13 changes: 13 additions & 0 deletions rest-api/resources/src/main/resources/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,19 @@ components:
count:
type: integer
description: The total count of the Entities available in the Scope
### Schema used in different yaml definitions, placed here for problems with swagger reference resolution ###
action:
type: string
enum:
- READ
- CREATE
- WRITE
- DELETE
- OPTIONS
- EXECUTE
- SUBMIT
- CANCEL
- SENT
### AccessInfo Entities ###
accessInfo:
$ref: './accessInfo/accessInfo.yaml#/components/schemas/accessInfo'
Expand Down

0 comments on commit fd877d7

Please sign in to comment.