Skip to content

Commit 5721358

Browse files
committed
wip
1 parent be30b38 commit 5721358

File tree

2 files changed

+193
-6
lines changed

2 files changed

+193
-6
lines changed

.github/workflows/openapi.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ jobs:
6363
run: |
6464
wget -O "${{ runner.temp }}/openapi-generator-cli.jar" \
6565
"https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/${{ steps.openapi_cli.outputs.version }}/openapi-generator-cli-${{ steps.openapi_cli.outputs.version }}.jar"
66-
-
67-
name: "Download spec"
68-
run: |
69-
wget -O "${{ runner.temp }}/spec.yaml" \
70-
"https://ec.europa.eu/assets/taxud/vow-information/swagger_publicVAT.yaml"
7166
-
7267
name: "Clean up previously generated files"
7368
run: |
@@ -78,7 +73,7 @@ jobs:
7873
PHP_POST_PROCESS_FILE: "php-cs-fixer fix --allow-risky yes"
7974
run: |
8075
java -jar "${{ runner.temp }}/openapi-generator-cli.jar" generate \
81-
--input-spec "${{ runner.temp }}/spec.yaml" \
76+
--input-spec ./openapi.yaml \
8277
--generator-name php-nextgen \
8378
--output ./ \
8479
--enable-post-process-file \

openapi.yml

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
swagger: "2.0"
2+
info:
3+
description: "This is the contract for Vies on-the-Web endpoints. The checkVat service supports exact and approximate matching at the same time. In order to retrieve the requestIdentifier, the information about requesterMemberStateCode and requesterNumber have to be provided."
4+
version: "1.0.0"
5+
title: "Vies on-the-Web Endpoint"
6+
produces:
7+
- "application/json"
8+
schemes:
9+
- "https"
10+
paths:
11+
/check-vat-number:
12+
post:
13+
tags:
14+
- "public"
15+
summary: "Check a Vat Number for a specific country"
16+
operationId: "checkVatNumber"
17+
parameters:
18+
- name: "body"
19+
in: "body"
20+
description: "The request body"
21+
required: true
22+
schema:
23+
$ref: "#/definitions/CheckVatRequest"
24+
responses:
25+
"200":
26+
description: "Successful operation"
27+
schema:
28+
$ref: "#/definitions/CheckVatResponse"
29+
"400":
30+
description: "Bad Request"
31+
schema:
32+
$ref: "#/definitions/CommonResponse"
33+
"500":
34+
description: "Internal server error"
35+
schema:
36+
$ref: "#/definitions/CommonResponse"
37+
/check-vat-test-service:
38+
post:
39+
tags:
40+
- "public"
41+
summary: "Test the check vat service"
42+
operationId: "checkVatTestService"
43+
parameters:
44+
- name: "body"
45+
in: "body"
46+
description: "The request body"
47+
required: true
48+
schema:
49+
$ref: "#/definitions/CheckVatRequest"
50+
responses:
51+
"200":
52+
description: "Successful operation"
53+
schema:
54+
$ref: "#/definitions/CheckVatResponse"
55+
"400":
56+
description: "Bad Request"
57+
schema:
58+
$ref: "#/definitions/CommonResponse"
59+
"500":
60+
description: "Internal server error"
61+
schema:
62+
$ref: "#/definitions/CommonResponse"
63+
/check-status:
64+
get:
65+
tags:
66+
- "public"
67+
summary: "Check the status of each member states"
68+
operationId: "checkStatus"
69+
responses:
70+
"200":
71+
description: "Successful operation"
72+
schema:
73+
$ref: "#/definitions/StatusInformationResponse"
74+
"400":
75+
description: "Bad Request"
76+
schema:
77+
$ref: "#/definitions/CommonResponse"
78+
"500":
79+
description: "Internal server error"
80+
schema:
81+
$ref: "#/definitions/CommonResponse"
82+
definitions:
83+
Status:
84+
type: "string"
85+
enum:
86+
- "VALID"
87+
- "INVALID"
88+
- "NOT_PROCESSED"
89+
CheckVatRequest:
90+
type: "object"
91+
properties:
92+
countryCode:
93+
type: "string"
94+
vatNumber:
95+
type: "string"
96+
requesterMemberStateCode:
97+
type: "string"
98+
requesterNumber:
99+
type: "string"
100+
traderName:
101+
type: "string"
102+
traderStreet:
103+
type: "string"
104+
traderPostalCode:
105+
type: "string"
106+
traderCity:
107+
type: "string"
108+
traderCompanyType:
109+
type: "string"
110+
CheckVatResponse:
111+
type: "object"
112+
properties:
113+
countryCode:
114+
type: "string"
115+
vatNumber:
116+
type: "string"
117+
requestDate:
118+
type: "string"
119+
format: "date-time"
120+
valid:
121+
type: "boolean"
122+
requestIdentifier:
123+
type: "string"
124+
name:
125+
type: "string"
126+
address:
127+
type: "string"
128+
traderName:
129+
type: "string"
130+
traderStreet:
131+
type: "string"
132+
traderPostalCode:
133+
type: "string"
134+
traderCity:
135+
type: "string"
136+
traderCompanyType:
137+
type: "string"
138+
traderNameMatch:
139+
$ref: "#/definitions/Status"
140+
traderStreetMatch:
141+
$ref: "#/definitions/Status"
142+
traderPostalCodeMatch:
143+
$ref: "#/definitions/Status"
144+
traderCityMatch:
145+
$ref: "#/definitions/Status"
146+
traderCompanyTypeMatch:
147+
$ref: "#/definitions/Status"
148+
CountryStatus:
149+
type: "object"
150+
properties:
151+
countryCode:
152+
type: "string"
153+
availability:
154+
type: "string"
155+
enum:
156+
- "Available"
157+
- "Unavailable"
158+
- "Monitoring Disabled"
159+
StatusInformationResponse:
160+
type: "object"
161+
properties:
162+
vow:
163+
type: "object"
164+
properties:
165+
available:
166+
type: "boolean"
167+
countries:
168+
type: "array"
169+
items:
170+
$ref: "#/definitions/CountryStatus"
171+
CommonResponse:
172+
type: "object"
173+
properties:
174+
actionSucceed:
175+
type: "boolean"
176+
description: "Indicate if the action succeed or not"
177+
errorWrappers:
178+
$ref: "#/definitions/ErrorWrappers"
179+
ErrorWrappers:
180+
type: "array"
181+
description: "Indicate the cause of the error when actionSucceed is false."
182+
items:
183+
$ref: "#/definitions/ErrorWrapper"
184+
ErrorWrapper:
185+
type: "object"
186+
description: "Define information about an error"
187+
properties:
188+
error:
189+
type: "string"
190+
description: "The error code"
191+
message:
192+
type: "string"

0 commit comments

Comments
 (0)