Skip to content

Commit

Permalink
[SELC-5401] docs: Enable release onboarding-functions OpenAPI docs on…
Browse files Browse the repository at this point in the history
… storage (#447)
  • Loading branch information
manuraf authored Aug 26, 2024
1 parent 603f18b commit 78c7faa
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/call_release_function.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
type: string
required: true
description: add '-pnpg' if workflow is related to pnpg
upload_openapi_enabled:
type: boolean
required: false
description: 'Set to True if workflow must upload openapi on storage'
default: false

jobs:
release:
Expand Down Expand Up @@ -55,3 +60,20 @@ jobs:
-Dquarkus.azure-functions.region=westeurope \
-Dquarkus.azure-functions.app-service-plan-name=${{ format('selc-{0}-onboarding-fn-plan', inputs.short_env) }} \
-Dquarkus.azure-functions.runtime.java-version=17
- name: Extract environment short
id: extract_env_short
run: |
env=${{ inputs.environment }}
echo "env_short=${env:0:1}" >> $GITHUB_OUTPUT
- name: Upload to blob storage
uses: azure/CLI@965c8d7571d2231a54e321ddd07f7b10317f34d9 # v2
if: ${{ inputs.upload_openapi_enabled }}
with:
inlineScript: |
az storage blob upload --auth-mode key -f apps/onboarding-functions/src/main/openapi/openapi.json --account-name selc${{ steps.extract_env_short.outputs.env_short }}checkoutsa -c selc-openapi -n pagopa/selfcare-onboarding-functions/openapi.json --overwrite
3 changes: 3 additions & 0 deletions .github/workflows/release_functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
with:
environment: dev
short_env: d
upload_openapi_enabled: true

release_uat:
uses: ./.github/workflows/call_release_function.yml
Expand All @@ -39,6 +40,7 @@ jobs:
with:
environment: uat
short_env: u
upload_openapi_enabled: true

release_prod:
uses: ./.github/workflows/call_release_function.yml
Expand All @@ -48,3 +50,4 @@ jobs:
with:
environment: prod
short_env: p
upload_openapi_enabled: true
137 changes: 137 additions & 0 deletions apps/onboarding-functions/src/main/openapi/openapi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
{
"openapi": "3.0.3",
"info": {
"title": "Onboarding Functions API",
"description": "Onboarding Functions API",
"version": "1.0.0"
},
"servers": [
{
"url": "https://${host}/${basePath}"
}
],
"paths": {
"/api/ResendNotification": {
"post": {
"tags": [
"Notification", "support"
],
"operationId": "sendOnboardigNotificationUsingPOST",
"summary": "",
"description": "",
"parameters": [
{
"name": "onboardingId",
"in": "query",
"description": "Onboarding Id",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"202": {
"description": "",
"content": {
"application/json": {}
}
}
},
"security": [
{
"bearerAuth": [
"global"
]
}
]
}
},
"/api/onboardings/notifications/count": {
"get": {
"tags": [
"Notification", "support"
],
"summary": "Count notifications by filters",
"description": "Performs for every product a count of relative onboarding notifications sent",
"operationId": "countNotificationsUsingGET",
"parameters": [
{
"name": "from",
"in": "query",
"description": "from date (in YYYY-MM-DD format)",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "to",
"in": "query",
"description": "to date (in YYYY-MM-DD format)",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "productId",
"in": "query",
"description": "productId",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/NotificationCountResult"
}
}
}
}
}
},
"security": [
{
"bearerAuth": [
"global"
]
}
]
}
}
},
"components": {
"schemas": {
"NotificationCountResult": {
"title": "NotificationCountResult",
"type": "object",
"properties": {
"notificationCount": {
"type": "integer",
"format": "int32"
},
"productId": {
"type": "string"
}
}
}
},
"securitySchemes": {
"bearerAuth": {
"type": "http",
"description": "A bearer token in the format of a JWS and conformed to the specifications included in [RFC8725](https://tools.ietf.org/html/RFC8725)",
"scheme": "bearer",
"bearerFormat": "JWT"
}
}
}
}
2 changes: 1 addition & 1 deletion apps/onboarding-ms/src/main/docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@
},
"/v1/onboarding/{onboardingId}/update" : {
"put" : {
"tags" : [ "Onboarding Controller" ],
"tags" : [ "support", "Onboarding" ],
"summary" : "Update onboarding request receiving onboarding id.Function can change some values. ",
"parameters" : [ {
"name" : "onboardingId",
Expand Down
3 changes: 2 additions & 1 deletion apps/onboarding-ms/src/main/docs/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,8 @@ paths:
/v1/onboarding/{onboardingId}/update:
put:
tags:
- Onboarding Controller
- support
- Onboarding
summary: 'Update onboarding request receiving onboarding id.Function can change
some values. '
parameters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ private Onboarding fillUserId(Onboarding onboarding, String userRequestUid) {
@Operation(summary = "Update onboarding request receiving onboarding id." +
"Function can change some values. ")
@PUT
@Tag(name = "support")
@Tag(name = "Onboarding")
@Consumes(MediaType.APPLICATION_JSON)
@Path("/{onboardingId}/update")
public Uni<Response> update(@PathParam(value = "onboardingId") String onboardingId,
Expand Down

0 comments on commit 78c7faa

Please sign in to comment.