diff --git a/.github/workflows/openapi-test.yaml b/.github/workflows/openapi-test.yaml new file mode 100644 index 00000000..613eb04b --- /dev/null +++ b/.github/workflows/openapi-test.yaml @@ -0,0 +1,18 @@ +name: OpenAPI Test + +on: + pull_request: + +jobs: + npm-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '16.x' + - name: Test + run: | + npm install -g @apidevtools/swagger-cli + npm install -g @stoplight/spectral + npm run test diff --git a/src/schemas/ClusterRequest.yaml b/src/schemas/ClusterRequest.yaml index e13d88b3..44c75dba 100644 --- a/src/schemas/ClusterRequest.yaml +++ b/src/schemas/ClusterRequest.yaml @@ -29,8 +29,7 @@ properties: example: "T3A_LARGE" description: the instance type to be used for this cluster. The list of values can be retrieved via the endpoint /{CloudProvider}/instanceType kubernetes: - $ref: ./enums/Kubernetes.yaml - default: "MANAGED" + $ref: './enums/Kubernetes.yaml' production: type: boolean description: specific flag to indicate that this cluster is a production one diff --git a/src/schemas/ClusterResponse.yaml b/src/schemas/ClusterResponse.yaml index 6d8cb00e..d1b85440 100644 --- a/src/schemas/ClusterResponse.yaml +++ b/src/schemas/ClusterResponse.yaml @@ -31,8 +31,7 @@ allOf: example: "T3A_LARGE" description: the instance type to be used for this cluster. The list of values can be retrieved via the endpoint /{CloudProvider}/instanceType kubernetes: - $ref: ./enums/Kubernetes.yaml - default: "MANAGED" + $ref: './enums/Kubernetes.yaml' cpu: type: integer example: 10000 diff --git a/src/schemas/CommitResponse.yaml b/src/schemas/CommitResponse.yaml index 9dccd570..01b55e2c 100644 --- a/src/schemas/CommitResponse.yaml +++ b/src/schemas/CommitResponse.yaml @@ -1,4 +1,5 @@ type: object +nullable: true required: - git_commit_id - created_at diff --git a/src/schemas/EnvironmentVariableResponse.yaml b/src/schemas/EnvironmentVariableResponse.yaml index ee8762a9..ef601b3b 100644 --- a/src/schemas/EnvironmentVariableResponse.yaml +++ b/src/schemas/EnvironmentVariableResponse.yaml @@ -16,13 +16,10 @@ allOf: service_id: type: string format: uuid - description: present only for `BUILT_IN` variable service_name: type: string - description: present only for `BUILT_IN` variable service_type: $ref: './enums/LinkedServiceType.yaml' - description: present only for `BUILT_IN` variable owned_by: type: string description: "Entity that created/own the variable (i.e: Qovery, Doppler)" diff --git a/src/schemas/Healthcheck.yaml b/src/schemas/Healthcheck.yaml index bd9ac60d..23755b6f 100644 --- a/src/schemas/Healthcheck.yaml +++ b/src/schemas/Healthcheck.yaml @@ -3,7 +3,5 @@ nullable: false properties: readiness_probe: $ref: './Probe.yaml' - nullable: true liveness_probe: $ref: './Probe.yaml' - nullable: true diff --git a/src/schemas/InviteMemberRequest.yaml b/src/schemas/InviteMemberRequest.yaml index 71e58e8c..8473d928 100644 --- a/src/schemas/InviteMemberRequest.yaml +++ b/src/schemas/InviteMemberRequest.yaml @@ -6,7 +6,6 @@ properties: type: string role: $ref: './enums/InviteMemberRole.yaml' - description: deprecated role_id: type: string format: uuid diff --git a/src/schemas/InviteMemberResponse.yaml b/src/schemas/InviteMemberResponse.yaml index 4b39c09f..6b2a4379 100644 --- a/src/schemas/InviteMemberResponse.yaml +++ b/src/schemas/InviteMemberResponse.yaml @@ -13,7 +13,6 @@ format: email role: $ref: './enums/InviteMemberRole.yaml' - description: deprecated invitation_link: type: string format: uri diff --git a/src/schemas/MemberResponse.yaml b/src/schemas/MemberResponse.yaml index 26d697f9..8431e1e0 100644 --- a/src/schemas/MemberResponse.yaml +++ b/src/schemas/MemberResponse.yaml @@ -20,7 +20,6 @@ allOf: description: last time the user was connected role: $ref: './enums/InviteMemberRole.yaml' - description: deprecated role_name: type: string description: the role linked to the user diff --git a/src/schemas/OrganizationEventResponse.yaml b/src/schemas/OrganizationEventResponse.yaml index dac641d7..c888c16f 100644 --- a/src/schemas/OrganizationEventResponse.yaml +++ b/src/schemas/OrganizationEventResponse.yaml @@ -15,16 +15,12 @@ properties: target_name: type: string target_type: - type: string $ref: './enums/OrganizationEventTargetType.yaml' sub_target_type: - type: string - nullable: true $ref: './enums/OrganizationEventSubTargetType.yaml' change: type: string origin: - type: string $ref: './enums/OrganizationEventOrigin.yaml' triggered_by: type: string diff --git a/src/schemas/Probe.yaml b/src/schemas/Probe.yaml index 9e86c460..b28c885c 100644 --- a/src/schemas/Probe.yaml +++ b/src/schemas/Probe.yaml @@ -1,4 +1,5 @@ type: object +nullable: true properties: type: type: object diff --git a/src/schemas/SecretResponse.yaml b/src/schemas/SecretResponse.yaml index d2019701..20ce1613 100644 --- a/src/schemas/SecretResponse.yaml +++ b/src/schemas/SecretResponse.yaml @@ -19,13 +19,10 @@ allOf: service_id: type: string format: uuid - description: present only for `BUILT_IN` variable service_name: type: string - description: present only for `BUILT_IN` variable service_type: $ref: './enums/LinkedServiceType.yaml' - description: present only for `BUILT_IN` variable owned_by: type: string description: "Entity that created/own the variable (i.e: Qovery, Doppler)" diff --git a/src/schemas/enums/Kubernetes.yaml b/src/schemas/enums/Kubernetes.yaml index 0768082c..4cd4234b 100644 --- a/src/schemas/enums/Kubernetes.yaml +++ b/src/schemas/enums/Kubernetes.yaml @@ -1,4 +1,5 @@ type: string enum: - "K3S" - - "MANAGED" \ No newline at end of file + - "MANAGED" +default: "MANAGED" diff --git a/src/schemas/enums/LinkedServiceType.yaml b/src/schemas/enums/LinkedServiceType.yaml index 44c4e44f..fb324c37 100644 --- a/src/schemas/enums/LinkedServiceType.yaml +++ b/src/schemas/enums/LinkedServiceType.yaml @@ -1,7 +1,5 @@ type: string -description: | - type of the service (application, database, job, gateway...) - present only for `BUILT_IN` variable +description: type of the service (application, database, job, gateway...) enum: - APPLICATION - CONTAINER diff --git a/src/schemas/enums/OrganizationEventSubTargetType.yaml b/src/schemas/enums/OrganizationEventSubTargetType.yaml index 315c4e3d..7281d51b 100644 --- a/src/schemas/enums/OrganizationEventSubTargetType.yaml +++ b/src/schemas/enums/OrganizationEventSubTargetType.yaml @@ -1,5 +1,6 @@ type: string description: Type of the organization event +nullable: true enum: - ADVANCED_SETTINGS - API_TOKEN diff --git a/src/schemas/job/DeploymentHistoryJobResponse.yaml b/src/schemas/job/DeploymentHistoryJobResponse.yaml index 20094b24..f874344f 100644 --- a/src/schemas/job/DeploymentHistoryJobResponse.yaml +++ b/src/schemas/job/DeploymentHistoryJobResponse.yaml @@ -13,7 +13,6 @@ allOf: type: string commit: $ref: '../CommitResponse.yaml' - nullable: true schedule: type: object properties: diff --git a/src/schemas/variable/VariableResponse.yaml b/src/schemas/variable/VariableResponse.yaml index dbdd81e9..22634e93 100644 --- a/src/schemas/variable/VariableResponse.yaml +++ b/src/schemas/variable/VariableResponse.yaml @@ -15,13 +15,12 @@ allOf: service_id: type: string format: uuid - description: The id of the service referenced by this variable. present only for `BUILT_IN` variable + description: The id of the service referenced by this variable. service_name: type: string - description: The name of the service referenced by this variable. present only for `BUILT_IN` variable + description: The name of the service referenced by this variable. service_type: $ref: '../enums/LinkedServiceType.yaml' - description: present only for `BUILT_IN` variable owned_by: type: string description: "Entity that created/own the variable (i.e: Qovery, Doppler)"