Skip to content

Commit 84ddd53

Browse files
tests-restored-locally
1 parent c689722 commit 84ddd53

File tree

5 files changed

+38
-21
lines changed

5 files changed

+38
-21
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ go 1.25.3
55
require (
66
github.com/DATA-DOG/go-sqlmock v1.5.1
77
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
8+
github.com/getkin/kin-openapi v0.88.0
89
github.com/google/go-jsonnet v0.17.0
910
github.com/jackc/pgtype v1.10.0
1011
github.com/jackc/pgx/v5 v5.0.4
@@ -17,7 +18,7 @@ require (
1718
github.com/spf13/cobra v1.4.0
1819
github.com/spf13/pflag v1.0.5
1920
github.com/spf13/viper v1.10.1
20-
github.com/stackql/any-sdk v0.4.1-alpha03
21+
github.com/stackql/any-sdk v0.4.1-alpha04
2122
github.com/stackql/go-suffix-map v0.0.1-alpha01
2223
github.com/stackql/psql-wire v0.1.2-alpha01
2324
github.com/stackql/stackql-parser v0.0.16-alpha01
@@ -70,7 +71,6 @@ require (
7071
github.com/dvsekhvalnov/jose2go v1.6.0 // indirect
7172
github.com/fsnotify/fsnotify v1.5.1 // indirect
7273
github.com/gabriel-vasile/mimetype v1.4.7 // indirect
73-
github.com/getkin/kin-openapi v0.88.0 // indirect
7474
github.com/ghodss/yaml v1.0.0 // indirect
7575
github.com/go-openapi/jsonpointer v0.19.5 // indirect
7676
github.com/go-openapi/swag v0.21.1 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,8 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
467467
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
468468
github.com/spf13/viper v1.10.1 h1:nuJZuYpG7gTj/XqiUwg8bA0cp1+M2mC3J4g5luUYBKk=
469469
github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU=
470-
github.com/stackql/any-sdk v0.4.1-alpha03 h1:tHH+GNkW3o8uB1++rA93+XlOxFL/btpGJ/10MbDr5KU=
471-
github.com/stackql/any-sdk v0.4.1-alpha03/go.mod h1:KTVgzZ2jlvGET55T/vzM7J+yIqpDOxbYFkoydaCs2K0=
470+
github.com/stackql/any-sdk v0.4.1-alpha04 h1:wcwx4OBBRd7S5A21Q6BzKvE/zbhgi4lKI8KC8Adblec=
471+
github.com/stackql/any-sdk v0.4.1-alpha04/go.mod h1:KTVgzZ2jlvGET55T/vzM7J+yIqpDOxbYFkoydaCs2K0=
472472
github.com/stackql/go-suffix-map v0.0.1-alpha01 h1:TDUDS8bySu41Oo9p0eniUeCm43mnRM6zFEd6j6VUaz8=
473473
github.com/stackql/go-suffix-map v0.0.1-alpha01/go.mod h1:QAi+SKukOyf4dBtWy8UMy+hsXXV+yyEE4vmBkji2V7g=
474474
github.com/stackql/psql-wire v0.1.2-alpha01 h1:RMBRURGspmSNqm2/sgoEc+D6Sri2y/3drjl4nKlOOi4=

internal/stackql/primitivegenerator/statement_analyzer.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"strings"
88
"time"
99

10+
"github.com/getkin/kin-openapi/openapi3"
1011
"github.com/stackql/any-sdk/anysdk"
1112
"github.com/stackql/any-sdk/pkg/constants"
1213
"github.com/stackql/any-sdk/pkg/dto"
@@ -951,7 +952,19 @@ func (pb *standardPrimitiveGenerator) expandTable(
951952
if err != nil {
952953
return err
953954
}
954-
availableServers, availableServersDoExist := svc.GetServers()
955+
var availableServers openapi3.Servers
956+
var availableServersDoExist bool
957+
method, _ := tbl.GetMethod()
958+
if method != nil {
959+
srvs, ok := method.GetServers()
960+
if ok && len(srvs) > 0 {
961+
availableServers = srvs
962+
availableServersDoExist = true
963+
}
964+
}
965+
if len(availableServers) == 0 {
966+
availableServers, availableServersDoExist = svc.GetServers()
967+
}
955968
if availableServersDoExist {
956969
for _, sv := range availableServers {
957970
for k := range sv.Variables {

test/python/stackql_test_tooling/flask/aws/root_path_cfg.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@
250250
},
251251
"GET:/:10": {
252252
"method": "GET",
253-
"path": "/stackql-trial-bucket-01",
253+
"path": "/",
254254
"queryStringParameters": {
255255
"max-keys": [ "1000" ]
256256
},
@@ -286,7 +286,7 @@
286286
},
287287
"GET:/:12": {
288288
"method": "GET",
289-
"path": "/stackql-trial-bucket-01",
289+
"path": "/",
290290
"queryStringParameters": {
291291
"location": [ "" ]
292292
},

test/registry/src/aws/v0.1.0/services/s3.yaml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,14 @@ paths:
879879
$ref: '#/components/schemas/ObjectNotInActiveTierError'
880880
description: |-
881881
The source object of the COPY action is not in the active tier and is only stored in Amazon S3 Glacier.
882-
/{Bucket}?max-keys=1000:
882+
/?max-keys=1000:
883+
servers:
884+
- url: 'https://{Bucket}.s3-{region}.amazonaws.com'
885+
variables:
886+
Bucket:
887+
default: stackql-trial-bucket-02
888+
region:
889+
default: us-east-1
883890
get:
884891
description: "This operation is not supported for directory buckets.\n\nReturns\
885892
\ some or all (up to 1,000) of the objects in a bucket. You can use the request\
@@ -900,11 +907,6 @@ paths:
900907
\ you must URL encode this value to `my%20%20file.txt`."
901908
operationId: ListObjects
902909
parameters:
903-
- in: path
904-
name: Bucket
905-
required: true
906-
schema:
907-
$ref: '#/components/schemas/BucketName'
908910
- in: header
909911
name: x-amz-content-sha256
910912
required: false
@@ -4890,7 +4892,14 @@ paths:
48904892
text/xml:
48914893
schema:
48924894
$ref: '#/components/schemas/GetBucketInventoryConfigurationOutput'
4893-
/{Bucket}?location:
4895+
/?location:
4896+
servers:
4897+
- url: https://{Bucket}.s3.{region}.amazonaws.com
4898+
variables:
4899+
region:
4900+
default: us-east-1
4901+
Bucket:
4902+
default: example-bucket
48944903
get:
48954904
operationId: GetBucketLocation
48964905
description: |-
@@ -4914,11 +4923,6 @@ paths:
49144923

49154924
You must URL encode any signed header values that contain spaces. For example, if your header value is `my file.txt`, containing two spaces after `my`, you must URL encode this value to `my%20%20file.txt`.
49164925
parameters:
4917-
- name: Bucket
4918-
in: path
4919-
required: true
4920-
schema:
4921-
$ref: '#/components/schemas/BucketName'
49224926
- name: x-amz-content-sha256
49234927
in: header
49244928
required: false
@@ -22400,7 +22404,7 @@ components:
2240022404
methods:
2240122405
get_bucket_location:
2240222406
operation:
22403-
$ref: '#/paths/~1{Bucket}?location/get'
22407+
$ref: '#/paths/~1?location/get'
2240422408
response:
2240522409
mediaType: text/xml
2240622410
openAPIDocKey: '200'
@@ -23206,7 +23210,7 @@ components:
2320623210
openAPIDocKey: '200'
2320723211
list_objects:
2320823212
operation:
23209-
$ref: '#/paths/~1{Bucket}?max-keys=1000/get'
23213+
$ref: '#/paths/~1?max-keys=1000/get'
2321023214
response:
2321123215
mediaType: text/xml
2321223216
openAPIDocKey: '200'

0 commit comments

Comments
 (0)