Skip to content

Commit 5b7fb04

Browse files
path-level-params (#469)
Summary: - Support for path level parameters in `openapi` docs. - Added robot test `Show Methods Path Level Parameters Considered as Exemplified by Azure Dev Center Customization Tasks Methods`. - Amended robot test `Show Extended Insert Google BQ Datasets` for expaanded parameters.
1 parent 9dab8f1 commit 5b7fb04

File tree

10 files changed

+8029
-5
lines changed

10 files changed

+8029
-5
lines changed

.vscode/launch.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@
149149
"select json_extract(detail.Properties, '$.KeyPolicy.Id') as key_policy_id, json_extract(detail.Properties, '$.Tags') as key_tags, json_extract(detail.Properties, '$.KeyUsage') as key_usage, json_extract(detail.Properties, '$.Origin') as key_origin, json_extract(detail.Properties, '$.MultiRegion') as key_is_multi_region, detail.region from aws.cloud_control.resources listing inner join aws.cloud_control.resource detail on detail.data__Identifier = listing.Identifier and detail.region = listing.region where listing.data__TypeName = 'AWS::KMS::Key' and listing.region in ('us-east-1', 'ap-southeast-1') and detail.data__TypeName = 'AWS::KMS::Key' order by key_policy_id;",
150150
"select listing.Identifier as key_policy_id, listing.region from aws.cloud_control.resources listing where listing.data__TypeName = 'AWS::KMS::Key' and listing.region in ('us-east-1', 'ap-southeast-1') order by key_policy_id;",
151151
"create or replace materialized view de_gen_01 as select json_extract_path_text(detail.Properties, 'KeyPolicy', 'Id') as key_policy_id, json_extract_path_text(detail.Properties, 'Tags') as key_tags, json_extract_path_text(detail.Properties, 'KeyUsage') as key_usage, json_extract_path_text(detail.Properties, 'Origin') as key_origin, case when json_extract_path_text(detail.Properties, 'MultiRegion') = 'true' then 1 else 0 end as key_is_multi_region, detail.region from aws.cloud_control.resources listing inner join aws.cloud_control.resource detail on detail.data__Identifier = listing.Identifier and detail.region = listing.region where listing.data__TypeName = 'AWS::KMS::Key' and listing.region IN ('us-east-1', 'ap-southeast-1') and detail.data__TypeName = 'AWS::KMS::Key' order by key_policy_id ASC ; select key_policy_id, key_tags, key_usage, key_origin, key_is_multi_region, region from de_gen_01 order by key_policy_id ASC ; drop materialized view if exists de_gen_01 ;",
152+
"show methods in azure.dev_center.customization_tasks;",
152153
],
153154
"default": "show providers;"
154155
},
@@ -162,7 +163,7 @@
162163
"{ \"url\": \"file://${workspaceFolder}/test/registry-mocked\", \"localDocRoot\": \"${workspaceFolder}/test/registry-mocked\", \"verifyConfig\": { \"nopVerify\": true } }",
163164
"{ \"url\": \"file://${workspaceFolder}/test/registry-mocked-native\", \"localDocRoot\": \"${workspaceFolder}/test/registry-mocked-native\", \"verifyConfig\": { \"nopVerify\": true } }",
164165
"{ \"url\": \"file://${workspaceFolder}/test/registry-advanced\", \"localDocRoot\": \"${workspaceFolder}/test/registry-advanced\", \"verifyConfig\": { \"nopVerify\": true } }",
165-
"{ \"url\": \"file://${workspaceFolder}/build/.stackql\", \"localDocRoot\": \"${workspaceFolder}/build/.stackql\" }",
166+
"{ \"url\": \"file://${workspaceFolder}/build/.stackql\", \"localDocRoot\": \"${workspaceFolder}/build/.stackql\", \"verifyConfig\": { \"nopVerify\": true } }",
166167
"{ \"url\": \"file://${workspaceFolder}/docs/examples/empty-registry\", \"localDocRoot\": \"${workspaceFolder}/docs/examples/empty-registry\" }",
167168
"{ \"url\": \"https://cdn.statically.io/gh/stackql/stackql-provider-registry/main/providers\", \"localDocRoot\": \"${workspaceFolder}/test/registry\" }",
168169
"{ \"url\": \"https://cdn.statically.io/gh/stackql/stackql-provider-registry/dev/providers\" }",

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ require (
2121
github.com/spf13/cobra v1.4.0
2222
github.com/spf13/pflag v1.0.5
2323
github.com/spf13/viper v1.10.1
24-
github.com/stackql/any-sdk v0.0.3-beta03
24+
github.com/stackql/any-sdk v0.0.3-beta09
2525
github.com/stackql/go-suffix-map v0.0.1-alpha01
2626
github.com/stackql/psql-wire v0.1.1-alpha07
2727
github.com/stackql/stackql-parser v0.0.14-alpha04

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,8 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
471471
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
472472
github.com/spf13/viper v1.10.1 h1:nuJZuYpG7gTj/XqiUwg8bA0cp1+M2mC3J4g5luUYBKk=
473473
github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU=
474-
github.com/stackql/any-sdk v0.0.3-beta03 h1:lH5YCF8XKdx054EdY6YhrB1ECGF7xgr574nGedDF8XQ=
475-
github.com/stackql/any-sdk v0.0.3-beta03/go.mod h1:CIMFo3fC2ScpqzkzeCkzUQQuzYA1VuqpG0p1EZXN+wY=
474+
github.com/stackql/any-sdk v0.0.3-beta09 h1:1Ddl3cpkaLC+3XXkEyAkKeunhMbYwRkWE4iPnTr+TfE=
475+
github.com/stackql/any-sdk v0.0.3-beta09/go.mod h1:CIMFo3fC2ScpqzkzeCkzUQQuzYA1VuqpG0p1EZXN+wY=
476476
github.com/stackql/go-suffix-map v0.0.1-alpha01 h1:TDUDS8bySu41Oo9p0eniUeCm43mnRM6zFEd6j6VUaz8=
477477
github.com/stackql/go-suffix-map v0.0.1-alpha01/go.mod h1:QAi+SKukOyf4dBtWy8UMy+hsXXV+yyEE4vmBkji2V7g=
478478
github.com/stackql/psql-wire v0.1.1-alpha07 h1:LQWVUlx4Bougk6dztDNG5tmXxpIVeeTSsInTj801xCs=

internal/stackql/metadatavisitors/requestvisitors.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ func ToInsertStatement(
134134
requiredOnly bool,
135135
) (string, error) {
136136
paramsToInclude := m.GetNonBodyParameters()
137+
if requiredOnly {
138+
paramsToInclude = m.GetRequiredNonBodyParameters()
139+
}
137140
successfullyIncludedCols := make(map[string]bool)
138141
if !extended {
139142
paramsToInclude = m.GetRequiredParameters()
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<<<jsonnet
2+
{
3+
alt: << alt >>,
4+
fields: << fields >>,
5+
key: << key >>,
6+
oauth_token: << oauth_token >>,
7+
prettyPrint: << prettyPrint >>,
8+
projectId: << projectId >>,
9+
quotaUser: << quotaUser >>,
10+
userIp: << userIp >>,
11+
data__access: [ {
12+
dataset: << dataset >>,
13+
domain: << domain >>,
14+
groupByEmail: << groupByEmail >>,
15+
iamMember: << iamMember >>,
16+
role: << role >>,
17+
routine: << routine >>,
18+
specialGroup: << specialGroup >>,
19+
userByEmail: << userByEmail >>,
20+
view: << view >>
21+
} ],
22+
data__datasetReference: {
23+
datasetId: << datasetId >>,
24+
projectId: << projectId >>
25+
},
26+
data__defaultEncryptionConfiguration: {
27+
kmsKeyName: << kmsKeyName >>
28+
},
29+
data__defaultPartitionExpirationMs: << data__defaultPartitionExpirationMs >>,
30+
data__defaultTableExpirationMs: << data__defaultTableExpirationMs >>,
31+
data__description: << data__description >>,
32+
data__friendlyName: << data__friendlyName >>,
33+
data__isCaseInsensitive: << data__isCaseInsensitive >>,
34+
data__labels: {
35+
<< data__labels[0].key >>: << data__labels[0].val >>
36+
},
37+
data__location: << data__location >>
38+
}
39+
>>>
40+
INSERT INTO google.bigquery.datasets(
41+
alt,
42+
fields,
43+
key,
44+
oauth_token,
45+
prettyPrint,
46+
projectId,
47+
quotaUser,
48+
userIp,
49+
data__access,
50+
data__datasetReference,
51+
data__defaultEncryptionConfiguration,
52+
data__defaultPartitionExpirationMs,
53+
data__defaultTableExpirationMs,
54+
data__description,
55+
data__friendlyName,
56+
data__isCaseInsensitive,
57+
data__labels,
58+
data__location
59+
)
60+
SELECT
61+
'{{ .values.alt }}',
62+
'{{ .values.fields }}',
63+
'{{ .values.key }}',
64+
'{{ .values.oauth_token }}',
65+
{{ .values.prettyPrint }},
66+
'{{ .values.projectId }}',
67+
'{{ .values.quotaUser }}',
68+
'{{ .values.userIp }}',
69+
'[ { "dataset": "{{ .values.data__access[0].dataset }}", "domain": "{{ .values.data__access[0].domain }}", "groupByEmail": "{{ .values.data__access[0].groupByEmail }}", "iamMember": "{{ .values.data__access[0].iamMember }}", "role": "{{ .values.data__access[0].role }}", "routine": "{{ .values.data__access[0].routine }}", "specialGroup": "{{ .values.data__access[0].specialGroup }}", "userByEmail": "{{ .values.data__access[0].userByEmail }}", "view": "{{ .values.data__access[0].view }}" } ]',
70+
'{ "datasetId": "{{ .values.data__datasetReference.datasetId }}", "projectId": "{{ .values.data__datasetReference.projectId }}" }',
71+
'{ "kmsKeyName": "{{ .values.data__defaultEncryptionConfiguration.kmsKeyName }}" }',
72+
'{{ .values.data__defaultPartitionExpirationMs }}',
73+
'{{ .values.data__defaultTableExpirationMs }}',
74+
'{{ .values.data__description }}',
75+
'{{ .values.data__friendlyName }}',
76+
{{ .values.data__isCaseInsensitive }},
77+
'{ "{{ .values.data__labels[0].key }}": "{{ .values.data__labels[0].val }}" }',
78+
'{{ .values.data__location }}'
79+
;

test/registry/src/azure/v0.1.0/provider.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,20 @@ providerServices:
353353
$ref: azure/v0.1.0/services/deployment_manager.yaml
354354
title: AzureDeploymentManager (Microsoft.DeploymentManager)
355355
version: v0.1.0
356+
dev_center:
357+
id: dev_center:v0.1.0
358+
name: dev_center
359+
preferred: true
360+
service:
361+
$ref: azure/v0.1.0/services/dev_center.yaml
362+
title: Dev Center
363+
version: v0.1.0
364+
description: >-
365+
Microsoft Dev Box is a service that enables you to provide preconfigured
366+
cloud-based workstations to your users through dev centers. Developers,
367+
testers, QA professionals, and others who need to get productive quickly
368+
on new projects can self-serve multiple dev boxes customized for their
369+
workloads.
356370
devops:
357371
description: Azure DevOps Resource Provider
358372
id: devops:v0.1.0

0 commit comments

Comments
 (0)