Skip to content

Commit

Permalink
reached consistency with enums on openApi doc files
Browse files Browse the repository at this point in the history
  • Loading branch information
angelo.andreussi authored and Coduz committed May 9, 2023
1 parent 3390072 commit 39f0a8b
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 72 deletions.
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
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 39f0a8b

Please sign in to comment.