Skip to content

Commit

Permalink
Merge branch 'main' into dii-1819
Browse files Browse the repository at this point in the history
  • Loading branch information
manisha1997 authored Feb 19, 2025
2 parents b538790 + 079f7bd commit 9b642dd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ jobs:
DOCKER_LOGIN: ${{ secrets.DOCKER_USERNAME && secrets.DOCKER_AUTH_TOKEN }}
steps:
- name: Checkout twilio-oai-generator
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up Java 11
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'

- name: Login to Docker Hub
if: env.DOCKER_LOGIN
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_AUTH_TOKEN }}
Expand All @@ -53,14 +53,14 @@ jobs:
- name: Remove pom file # Otherwise, the Sonar action fails and recommends using the Maven plugin
run: rm pom.xml

- name: Install SonarCloud scanner and run analysis
uses: SonarSource/sonarcloud-github-action@master
if: (github.event_name == 'pull_request' || github.ref_type == 'branch') && !github.event.pull_request.head.repo.fork && startsWith(matrix.language, 'csharp') != true
with:
projectBaseDir: examples/${{ matrix.language }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# - name: Install SonarCloud scanner and run analysis
# uses: SonarSource/sonarcloud-github-action@master
# if: (github.event_name == 'pull_request' || github.ref_type == 'branch') && !github.event.pull_request.head.repo.fork && startsWith(matrix.language, 'csharp') != true
# with:
# projectBaseDir: examples/${{ matrix.language }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

notify-on-failure:
name: Slack notify on failure
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/com/twilio/oai/TwilioGoGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,17 @@ public OperationsMap postProcessOperationsWithModels(final OperationsMap objs, L
if (co.nickname.startsWith("List")) {
// make sure the format matches the other methods
co.vendorExtensions.put("x-domain-name", co.nickname.replaceFirst("List", ""));
co.allParams.forEach( p -> {
if( p.dataType.equals("int64") && ( p.baseName.equals("PageSize") || p.baseName.equals("limit") ) ){
p.dataType = "int";
}
});

co.optionalParams.forEach( p -> {
if( p.dataType.equals("int64") && ( p.baseName.equals("PageSize") || p.baseName.equals("limit") ) ){
p.dataType = "int";
}
});

// filter the fields in the model and get only the array typed field. Also, make sure there is only one field of type list/array
if (returnModel.isPresent()) {
Expand Down

0 comments on commit 9b642dd

Please sign in to comment.