Skip to content
Draft
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
21 changes: 21 additions & 0 deletions .github/workflows/openapi-update-generate-new-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,27 @@ jobs:
run: |
curl -s https://api-ch-gva-2.exoscale.com/v2/openapi.json -o api/openapi.yaml

- name: Inject vendor extensions into OpenAPI definition
shell: bash
run: |
python3 - <<'EOF'
import json

with open('api/openapi.yaml') as f:
spec = json.load(f)

# list-zones returns public data but the server enforces IAM role policies
# on authenticated requests. Restricted keys (e.g. DBaaS-only) get 403.
# Mark it with x-skip-auth so the generator omits the Authorization header.
for path_item in spec.get('paths', {}).values():
for op in path_item.values():
if isinstance(op, dict) and op.get('operationId') == 'list-zones':
op['x-skip-auth'] = True

with open('api/openapi.yaml', 'w') as f:
json.dump(spec, f, separators=(',', ':'))
EOF

- name: Check for changes in OpenAPI definition
id: changes
run: |
Expand Down
2 changes: 1 addition & 1 deletion api/openapi.yaml

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions generator/libraries/native/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,17 @@ public class {{classname}} {
{{/bodyParam}}


// Operations tagged x-skip-auth return public data but the server enforces IAM
// role policies on authenticated requests. Restricted keys (e.g. DBaaS-only) get 403.
// Skip signing so those requests are always sent without credentials.
{{^vendorExtensions.x-skip-auth}}
try{
authorizationValue = credentials.generateSignature("{{httpMethod}}", "/v2"+localVarPath , requestBody != null ? requestBody : "");
} catch (Exception e) {
throw new ApiException(500, "Failed to generate signature: " + e.getMessage());
}
localVarRequestBuilder.header("Authorization", authorizationValue);
{{/vendorExtensions.x-skip-auth}}
{{#hasQueryParams}}
List<Pair> localVarQueryParams = new ArrayList<>();
StringJoiner localVarQueryStringJoiner = new StringJoiner("&");
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>https://api-ch-gva-2.exoscale.com/v2/openapi.json</inputSpec>
<inputSpec>${project.basedir}/api/openapi.yaml</inputSpec>
<generatorName>java</generatorName>
<library>native</library>
<openapiNormalizer>
Expand Down
2 changes: 1 addition & 1 deletion sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Java SDK for interacting with Exoscale Cloud Services.

- API version: 2.0.0

- Build date: 2026-04-18T07:30:19.997697928Z[Etc/UTC]
- Build date: 2026-04-28T21:12:59.990672440+02:00[Europe/Paris]



Expand Down
1 change: 1 addition & 0 deletions sdk/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1946,6 +1946,7 @@ paths:
summary: List Zones
tags:
- exoscale
x-skip-auth: true
x-accepts: application/json
/instance-pool:
get:
Expand Down
1,020 changes: 1,014 additions & 6 deletions sdk/src/main/java/com/exoscale/sdk/api/ExoscaleApi.java

Large diffs are not rendered by default.