Skip to content

Commit df8a1c2

Browse files
committed
ci: Replace APIGurus as source for IT
1 parent bbdb505 commit df8a1c2

2 files changed

Lines changed: 65 additions & 164 deletions

File tree

it/Readme.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,61 @@ Generate the code:
1414
./it/generate-code.ps1 -descriptionUrl ${FILE/URL} -language ${LANG}
1515
```
1616

17+
Instead of publishing, you could also build the project and use the "-Dev" switch that executes Kiota from "src\kiota\bin\Debug\net8.0":
18+
19+
```bash
20+
./it/generate-code.ps1 -descriptionUrl ${FILE/URL} -language ${LANG} -Dev
21+
```
22+
1723
And finally run the test:
1824

1925
```bash
2026
./it/exec-cmd.ps1 -descriptionUrl ${FILE/URL} -language ${LANG}
2127
```
2228

29+
# Suppressions
30+
31+
Some API files do not work for a specific target language. There are two ways to define suppressions:
32+
33+
## Suppress the full test
34+
35+
This will execute the test in Github CI anyway and maybe an error will happen, but the test will not be marked as "failed" (see "integration-tests.yml" and "get-is-suppressed.ps1")
36+
37+
```
38+
"https://www.sample.com/sample-api.json": {
39+
"MockServerITFolder": "sampleapi",
40+
"Suppressions": [
41+
{
42+
"Language": "ruby",
43+
"Rationale": "Feature x in file is not supported for ruby."
44+
}
45+
]
46+
}
47+
```
48+
49+
## Suppress creating certain API paths
50+
51+
This will tell Kiota not to generate the code for the specified endpoint. Use it if something inside this endpoint definition is either invalid OpenAPI
52+
or Kiota cannot handle it.
53+
54+
```
55+
"https://www.sample.com/sample-api.json": {
56+
"MockServerITFolder": "sampleapi",
57+
"ExcludePatterns": [
58+
{
59+
"Pattern": "/users/*/gpg_keys",
60+
"Rationale": "invalid data type for argument XYZ"
61+
}
62+
{
63+
"Pattern": "/repos/{owner}/{repo}/releases#POST",
64+
"Rationale": "here is something wrong, too"
65+
}
66+
]
67+
}
68+
```
69+
70+
The second snippet demonstrates that you can suppress also creating a method for just one of the HTTP methods of an endpoint.
71+
2372
# MockServer tests
2473

2574
The OpenAPI description can be published to a mock server, and you can execute tests that call this API.

it/config.json

Lines changed: 16 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
{
22
"./tests/Kiota.Builder.IntegrationTests/InheritingErrors.yaml": {
3-
"MockServerITFolder": "basic",
4-
"Suppressions": [
5-
{
6-
"Language": "ruby",
7-
"Rationale": "https://github.com/microsoft/kiota/issues/2484"
8-
}
9-
]
3+
"MockServerITFolder": "basic"
104
},
115
"./tests/Kiota.Builder.IntegrationTests/GeneratesUritemplateHints.yaml": {
126
"MockServerITFolder": "query-params",
137
"Suppressions": [
148
{
159
"Language": "ruby",
16-
"Rationale": "https://github.com/microsoft/kiota/issues/4262"
10+
"Rationale": "https://github.com/microsoft/kiota/issues/4262 (moved to https://github.com/microsoft/kiota-abstractions-ruby/issues/59)"
1711
}
1812
]
1913
},
@@ -22,174 +16,46 @@
2216
"Suppressions": [
2317
{
2418
"Language": "ruby",
25-
"Rationale": "https://github.com/microsoft/kiota/issues/2484"
19+
"Rationale": "https://github.com/microsoft/kiota-abstractions-ruby/issues/66"
2620
}
2721
]
2822
},
2923
"./tests/Kiota.Builder.IntegrationTests/ModelWithDefaultValues.json": {
3024
"MockServerITFolder": "defaultvalues"
3125
},
32-
"apisguru::github.com:api.github.com": {
26+
"https://github.com/github/rest-api-description/raw/refs/heads/main/descriptions/api.github.com/api.github.com.json": {
3327
"MockServerITFolder": "gh",
3428
"Suppressions": [
3529
{
3630
"Language": "ruby",
37-
"Rationale": "https://github.com/microsoft/kiota/issues/1816"
38-
}
39-
],
40-
"ExcludePatterns": [
41-
{
42-
"Pattern": "/users/*/gpg_keys",
43-
"Rationale": "https://github.com/github/rest-api-description/issues/2247"
44-
},
45-
{
46-
"Pattern": "/user/gpg_keys",
47-
"Rationale": "https://github.com/github/rest-api-description/issues/2247"
48-
},
49-
{
50-
"Pattern": "/user/gpg_keys/**",
51-
"Rationale": "https://github.com/github/rest-api-description/issues/2247"
52-
},
53-
{
54-
"Pattern": "/repos/{owner}/{repo}/releases/{release_id}#PATCH",
55-
"Rationale": "https://github.com/microsoft/kiota/pull/7414#issuecomment-4033965839 and https://github.com/github/rest-api-description/issues/6100 (default value for enum is not quoted)"
56-
},
57-
{
58-
"Pattern": "/repos/{owner}/{repo}/releases#POST",
59-
"Rationale": "https://github.com/microsoft/kiota/pull/7414#issuecomment-4033965839 (default value for enum is not quoted, fixed in recent file as of 03/2026 but not updated to APIGurus)"
31+
"Rationale": "https://github.com/microsoft/kiota/issues/1816 (moved to https://github.com/microsoft/kiota-abstractions-ruby/issues/73)"
6032
}
6133
]
6234
},
63-
"apisguru::notion.com": {
64-
"ExcludePatterns": [
65-
{
66-
"Pattern": "/v1/databases/**",
67-
"Rationale": "next_cursor in commentResponse is invalid"
68-
},
69-
{
70-
"Pattern": "/v1/blocks/**",
71-
"Rationale": "next_cursor in commentResponse is invalid"
72-
},
73-
{
74-
"Pattern": "/v1/comments",
75-
"Rationale": "next_cursor in commentResponse is invalid"
76-
},
77-
{
78-
"Pattern": "/v1/users/*",
79-
"Rationale": "avatar_url in usersResponse is invalid"
80-
},
81-
{
82-
"Pattern": "/v1/pages/*",
83-
"Rationale": "code in pageResponse is invalid"
84-
}
85-
],
35+
"https://developers.notion.com/openapi.json": {
8636
"Suppressions": [
8737
{
8838
"Language": "ruby",
89-
"Rationale": "https://github.com/microsoft/kiota/issues/2484"
39+
"Rationale": "https://github.com/microsoft/kiota/issues/2484 (moved to https://github.com/microsoft/kiota-abstractions-ruby/issues/66)"
9040
}
9141
]
9242
},
9343
"https://raw.githubusercontent.com/googlemaps/openapi-specification/refs/tags/v1.22.5/dist/google-maps-platform-openapi3.yml": {
94-
"ExcludePatterns": [
95-
{
96-
"Pattern": "/maps/api/directions/json",
97-
"Rationale": "DirectionsGeocodedWaypoint.partial_match is invalid"
98-
}
99-
],
100-
"Suppressions": [
101-
{
102-
"Language": "ruby",
103-
"Rationale": "https://github.com/microsoft/kiota/issues/2484"
104-
}
105-
]
10644
},
10745
"https://developers.pipedrive.com/docs/api/v1/openapi.yaml": {
108-
"ExcludePatterns": [
109-
{
110-
"Pattern": "/itemSearch/field",
111-
"Rationale": "$field_key for fieldResponse_data is invalid"
112-
},
113-
{
114-
"Pattern": "/subscriptions/*/payments",
115-
"Rationale": "data for model paymentsResponse is invalid"
116-
},
117-
{
118-
"Pattern": "/permissionSets/**",
119-
"Rationale": "error 404 is invalid"
120-
},
121-
{
122-
"Pattern": "/oauth/token/",
123-
"Rationale": "Duplicate path exists in the spec without the trailing '/'"
124-
}
125-
],
12646
"Suppressions": [
12747
{
12848
"Language": "ruby",
129-
"Rationale": "https://github.com/microsoft/kiota/issues/2484"
49+
"Rationale": "https://github.com/microsoft/kiota/issues/2484 (moved to https://github.com/microsoft/kiota-abstractions-ruby/issues/66)"
13050
}
13151
],
13252
"IdempotencySuppressions": []
13353
},
134-
"apisguru::twilio.com:api": {
135-
"ExcludePatterns": [
136-
{
137-
"Pattern": "/2010-04-01/Accounts/*/Addresses/*/DependentPhoneNumbers.json",
138-
"Rationale": "dependent_phone_number is invalid"
139-
},
140-
{
141-
"Pattern": "/2010-04-01/Accounts/*/Recordings.json",
142-
"Rationale": "encryption_details is invalid"
143-
},
144-
{
145-
"Pattern": "/2010-04-01/Accounts/*/Recordings/*.json",
146-
"Rationale": "encryption_details is invalid"
147-
},
148-
{
149-
"Pattern": "/2010-04-01/Accounts/*/Conferences/*/Recordings.json",
150-
"Rationale": "encryption_details is invalid"
151-
},
152-
{
153-
"Pattern": "/2010-04-01/Accounts/*/Calls/*/Recordings.json",
154-
"Rationale": "encryption_details is invalid"
155-
},
156-
{
157-
"Pattern": "/2010-04-01/Accounts/*/Calls/*/Recordings/*.json",
158-
"Rationale": "encryption_details is invalid"
159-
},
160-
{
161-
"Pattern": "/2010-04-01/Accounts/*/Conferences/*/Recordings/*.json",
162-
"Rationale": "encryption_details is invalid"
163-
},
164-
{
165-
"Pattern": "/2010-04-01/Accounts/*/Calls/FeedbackSummary.json",
166-
"Rationale": "issues is invalid"
167-
},
168-
{
169-
"Pattern": "/2010-04-01/Accounts/*/Calls/FeedbackSummary/*.json",
170-
"Rationale": "issues is invalid"
171-
},
172-
{
173-
"Pattern": "/2010-04-01/Accounts/*/Calls/*/Events.json",
174-
"Rationale": "request is invalid"
175-
},
176-
{
177-
"Pattern": "/2010-04-01/Accounts/*/IncomingPhoneNumbers/*/AssignedAddOns.json",
178-
"Rationale": "configuration is invalid"
179-
},
180-
{
181-
"Pattern": "/2010-04-01/Accounts/*/IncomingPhoneNumbers/*/AssignedAddOns/*.json",
182-
"Rationale": "configuration is invalid"
183-
},
184-
{
185-
"Pattern": "/2010-04-01/Accounts/*/Calls/*/Payments.json",
186-
"Rationale": "Parameter is invalid"
187-
}
188-
],
54+
"https://raw.githubusercontent.com/twilio/twilio-oai/refs/heads/main/spec/yaml/twilio_api_v2010.yaml": {
18955
"Suppressions": [
19056
{
19157
"Language": "ruby",
192-
"Rationale": "https://github.com/microsoft/kiota/issues/2484"
58+
"Rationale": "https://github.com/microsoft/kiota/issues/2484 (moved to https://github.com/microsoft/kiota-abstractions-ruby/issues/66). The API of 06/2026 reports an error 'The element to rename was not found available_phone_number_countryModelModelModelModel'"
19359
}
19460
],
19561
"IdempotencySuppressions": [
@@ -199,16 +65,12 @@
19965
}
20066
]
20167
},
202-
"apisguru::stripe.com": {
68+
"https://raw.githubusercontent.com/stripe/openapi/refs/heads/master/latest/openapi.spec3.json": {
20369
"Suppressions": [
20470
{
20571
"Language": "java",
20672
"Rationale": "https://github.com/microsoft/kiota/issues/2842"
20773
},
208-
{
209-
"Language": "python",
210-
"Rationale": "https://github.com/microsoft/kiota/issues/2842"
211-
},
21274
{
21375
"Language": "ruby",
21476
"Rationale": "https://github.com/microsoft/kiota/issues/1816"
@@ -223,37 +85,27 @@
22385
"Language": "java",
22486
"Rationale": "https://github.com/microsoft/kiota/issues/2842"
22587
},
226-
{
227-
"Language": "python",
228-
"Rationale": "https://github.com/microsoft/kiota/issues/2842"
229-
},
23088
{
23189
"Language": "ruby",
23290
"Rationale": "https://github.com/microsoft/kiota/issues/1816"
23391
}
23492
]
23593
},
236-
"apisguru::meraki.com": {
94+
"https://raw.githubusercontent.com/meraki/openapi/refs/heads/master/openapi/spec3.json": {
23795
"Suppressions": [
23896
{
23997
"Language": "ruby",
240-
"Rationale": "https://github.com/microsoft/kiota/issues/2484"
98+
"Rationale": "https://github.com/microsoft/kiota/issues/2484 (moved to https://github.com/microsoft/kiota-abstractions-ruby/issues/66)"
24199
}
242100
]
243101
},
244-
"apisguru::docusign.net": {
245-
"Suppressions": [
246-
{
247-
"Language": "ruby",
248-
"Rationale": "https://github.com/microsoft/kiota/issues/2484"
249-
}
250-
]
102+
"https://raw.githubusercontent.com/docusign/OpenAPI-Specifications/refs/heads/master/esignature.rest.swagger-v2.1.json": {
251103
},
252-
"apisguru::twitter.com:current": {
104+
"https://api.twitter.com/2/openapi.json": {
253105
"Suppressions": [
254106
{
255107
"Language": "ruby",
256-
"Rationale": "https://github.com/microsoft/kiota/issues/1816"
108+
"Rationale": "https://github.com/microsoft/kiota/issues/1816 (moved to https://github.com/microsoft/kiota-abstractions-ruby/issues/73)"
257109
}
258110
],
259111
"IdempotencySuppressions": []

0 commit comments

Comments
 (0)