Skip to content

Commit

Permalink
PAGOPA-1495 modifying doc and openapi
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoRuzzier committed Mar 5, 2024
1 parent 8ef3b8f commit bc95a8f
Show file tree
Hide file tree
Showing 19 changed files with 2,416 additions and 3,594 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
- name: Check Size
uses: actions/[email protected]
env:
IGNORED_FILES: openapi.json, openapi-node.json
IGNORED_FILES: openapi-v1.json, openapi-v2.json, openapi-node-v1.json, openapi-node-v2.json
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/update_infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ on:
- main
types: [ closed ]
paths:
- 'openapi/openapi.json'
- 'openapi/openapi-node.json'
- 'openapi/openapi-v1.json'
- 'openapi/openapi-v2.json'
- 'openapi/openapi-node-v1.json'
- 'openapi/openapi-node-v2.json'


workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion .opex/internal/env/prod/config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
oa3_spec: ./openapi/openapi.json # If start with http the file would be downloaded from the internet
oa3_spec: ./openapi/openapi-v1.json # If start with http the file would be downloaded from the internet
name: opex_pagopa-afm-calculator
location: West Europe
timespan: 5m # Default, a number or a timespan https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/scalar-data-types/timespan
Expand Down
2 changes: 1 addition & 1 deletion .opex/node/env/prod/config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
oa3_spec: ./openapi/openapi-node.json # If start with http the file would be downloaded from the internet
oa3_spec: ./openapi/openapi-node-v1.json # If start with http the file would be downloaded from the internet
name: opex_pagopa-afm-calculator_node
location: West Europe
timespan: 5m # Default, a number or a timespan https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/scalar-data-types/timespan
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ Spring Application exposes API to calculate taxpayer fees according to [_AFM Mar

---
## API Documentation 📖
See the [OpenApi 3 here](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/pagopa-afm-calculator/main/openapi/openapi.json)
See the Openapi files at the following links:
- [OpenApi V1](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/pagopa-afm-calculator/main/openapi/openapi-v1.json)
- [OpenApi V2](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/pagopa-afm-calculator/main/openapi/openapi-v2.json)
- [OpenApi for Nodo dei pagamenti V1](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/pagopa-afm-calculator/main/openapi/openapi-node-v1.json)
- [OpenApi for Nodo dei pagamenti V2](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/pagopa-afm-calculator/main/openapi/openapi-node-v2.json)

See the [OpenApi 3 here](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/pagopa-afm-calculator/main/openapi/openapi-node.json) **for Nodo dei pagamenti**

Expand Down
11 changes: 3 additions & 8 deletions openapi/generate_openapi.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
#!/bin/bash

# install api-spec-converter if not present
if [ $(npm list -g | grep -c api-spec-converter) -eq 0 ]; then
npm install -g api-spec-converter
if [[ "$(pwd)" =~ .*"openapi".* ]]; then
cd ..
fi

# save openapi
curl http://localhost:8080/v3/api-docs | python3 -m json.tool > ./openapi.json
python3 generate_openapi_node.py ./openapi.json

# UI mode http://localhost:8080/swagger-ui/index.html
mvn test -Dtest=OpenApiGenerationTest
22 changes: 0 additions & 22 deletions openapi/generate_openapi_node.py

This file was deleted.

7 changes: 0 additions & 7 deletions openapi/generate_openapi_v1_v2.sh

This file was deleted.

Loading

0 comments on commit bc95a8f

Please sign in to comment.