Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAGOPA-1495 modifying doc and openapi #130

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/github-script@v6.3.3
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
Loading