Skip to content

Commit 91c8ad4

Browse files
authored
Fix defaultNonNullable behavior (#1445)
1 parent a9f54ae commit 91c8ad4

File tree

67 files changed

+18423
-4430
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+18423
-4430
lines changed

packages/openapi-typescript/examples/digital-ocean-api.ts

+275-32
Large diffs are not rendered by default.

packages/openapi-typescript/examples/digital-ocean-api/DigitalOcean-public.v2.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -1271,6 +1271,18 @@ paths:
12711271
get:
12721272
$ref: 'resources/monitoring/monitoring_get_dropletMemoryAvailableMetrics.yml'
12731273

1274+
/v2/monitoring/metrics/apps/memory_percentage:
1275+
get:
1276+
$ref: 'resources/monitoring/monitoring_get_appMemoryPercentageMetrics.yml'
1277+
1278+
/v2/monitoring/metrics/apps/cpu_percentage:
1279+
get:
1280+
$ref: 'resources/monitoring/monitoring_get_appCPUPercentageMetrics.yml'
1281+
1282+
/v2/monitoring/metrics/apps/restart_count:
1283+
get:
1284+
$ref: 'resources/monitoring/monitoring_get_appRestartCountMetrics.yml'
1285+
12741286
/v2/projects:
12751287
get:
12761288
$ref: 'resources/projects/projects_list.yml'

packages/openapi-typescript/examples/digital-ocean-api/resources/apps/models/app_functions_spec.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@
22

33
type: object
44
properties:
5+
56
cors:
6-
$ref: apps_cors_policy.yml
7+
allOf:
8+
- $ref: apps_cors_policy.yml
9+
- description: (Deprecated - Use Ingress Rules instead).
10+
- deprecated: true
711

812
routes:
913
type: array
10-
description: A list of HTTP routes that should be routed to this component.
14+
description: (Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
15+
deprecated: true
1116
items:
1217
$ref: app_route_spec.yml
1318

packages/openapi-typescript/examples/digital-ocean-api/resources/apps/models/app_route_spec.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ title: A criterion for routing HTTP traffic to a component.
22
type: object
33
properties:
44
path:
5-
description: An HTTP path prefix. Paths must start with / and must be unique across
5+
description: (Deprecated - Use Ingress Rules instead). An HTTP path prefix. Paths must start with / and must be unique across
66
all components within an app.
77
type: string
88
example: /api

packages/openapi-typescript/examples/digital-ocean-api/resources/apps/models/app_service_spec.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ allOf:
55
- type: object
66
properties:
77
cors:
8-
$ref: apps_cors_policy.yml
8+
allOf:
9+
- $ref: apps_cors_policy.yml
10+
- description: (Deprecated - Use Ingress Rules instead).
11+
- deprecated: true
912

1013
health_check:
1114
$ref: app_service_spec_health_check.yml
@@ -32,7 +35,8 @@ allOf:
3235

3336
routes:
3437
type: array
35-
description: A list of HTTP routes that should be routed to this component.
38+
description: (Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
39+
deprecated: true
3640
items:
3741
$ref: app_route_spec.yml
3842

packages/openapi-typescript/examples/digital-ocean-api/resources/apps/models/app_static_site_spec.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,17 @@ allOf:
3333
example: dist/
3434

3535
cors:
36-
$ref: apps_cors_policy.yml
36+
allOf:
37+
- $ref: apps_cors_policy.yml
38+
- description: (Deprecated - Use Ingress Rules instead).
39+
- deprecated: true
3740

3841
routes:
3942
type: array
4043
items:
4144
$ref: app_route_spec.yml
42-
description: A list of HTTP routes that should be routed to this component.
45+
description: (Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
46+
deprecated: true
4347

4448
required:
4549
- name

packages/openapi-typescript/examples/digital-ocean-api/resources/apps/models/apps_image_source_spec.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@ properties:
2222

2323
tag:
2424
type: string
25-
description: The repository tag. Defaults to `latest` if not provided.
25+
description: The repository tag. Defaults to `latest` if not provided and no digest is provided. Cannot be specified if digest is provided.
2626
example: latest
2727
default: latest
28+
29+
digest:
30+
type: string
31+
description: The image digest. Cannot be specified if tag is provided.
32+
example: sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041ac
33+
34+
deploy_on_push:
35+
type: object
36+
properties:
37+
enabled:
38+
type: boolean
39+
description: Whether to automatically deploy new images. Can only be used for images hosted in DOCR and can only be used with an image tag, not a specific digest.
40+
example: true

packages/openapi-typescript/examples/digital-ocean-api/resources/databases/databases_add_user.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,11 @@ requestBody:
6060
name: app-03
6161
settings:
6262
acl:
63-
- id: acl128aaaa99239
64-
permission: produceconsume
63+
- permission: produceconsume
6564
topic: customer-events
66-
- id: acl293098flskdf
67-
permission: produce
65+
- permission: produce
6866
topic: customer-events.*
69-
- id: acl128ajei20123
70-
permission: consume
67+
- permission: consume
7168
topic: customer-events
7269

7370
responses:

packages/openapi-typescript/examples/digital-ocean-api/resources/databases/databases_create_cluster.yml

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ requestBody:
4545
version: "14"
4646
region: nyc3
4747
size: db-s-2vcpu-4gb
48+
storage_size_mib: 61440
4849
num_nodes: 2
4950
tags:
5051
- production
@@ -57,6 +58,7 @@ requestBody:
5758
region: nyc3
5859
size: db-s-2vcpu-4gb
5960
num_nodes: 2
61+
storage_size_mib: 61440
6062
tags:
6163
- production
6264
rules:

packages/openapi-typescript/examples/digital-ocean-api/resources/databases/databases_create_kafka_topic.yml

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ responses:
5151

5252
x-codeSamples:
5353
- $ref: 'examples/curl/databases_create_topic.yml'
54+
- $ref: 'examples/go/databases_create_topic.yml'
5455

5556
security:
5657
- bearer_auth:

packages/openapi-typescript/examples/digital-ocean-api/resources/databases/databases_create_replica.yml

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ requestBody:
3838
name: read-nyc3-01
3939
region: nyc3
4040
size: db-s-2vcpu-4gb
41+
storage_size_mib: 61440
4142

4243
responses:
4344
'201':

packages/openapi-typescript/examples/digital-ocean-api/resources/databases/databases_delete_kafka_topic.yml

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ responses:
3737

3838
x-codeSamples:
3939
- $ref: 'examples/curl/databases_delete_topic.yml'
40+
- $ref: 'examples/go/databases_delete_topic.yml'
4041

4142
security:
4243
- bearer_auth:

packages/openapi-typescript/examples/digital-ocean-api/resources/databases/databases_get_kafka_topic.yml

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ responses:
3636

3737
x-codeSamples:
3838
- $ref: 'examples/curl/databases_get_topic.yml'
39+
- $ref: 'examples/go/databases_get_topic.yml'
3940

4041
security:
4142
- bearer_auth:

packages/openapi-typescript/examples/digital-ocean-api/resources/databases/databases_list_kafka_topics.yml

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ responses:
3535

3636
x-codeSamples:
3737
- $ref: 'examples/curl/databases_list_topics.yml'
38+
- $ref: 'examples/go/databases_list_topics.yml'
3839

3940
security:
4041
- bearer_auth:

packages/openapi-typescript/examples/digital-ocean-api/resources/databases/databases_update_clusterSize.yml

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ requestBody:
2929
example:
3030
size: db-s-4vcpu-8gb
3131
num_nodes: 3
32+
storage_size_mib: 163840
3233

3334
responses:
3435
'202':

packages/openapi-typescript/examples/digital-ocean-api/resources/databases/databases_update_kafka_topic.yml

+6-9
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,12 @@ requestBody:
2121
schema:
2222
allOf:
2323
- $ref: 'models/kafka_topic_update.yml'
24-
required:
25-
- topic
2624
example:
27-
topic:
28-
name: customer-events
29-
partitions: 3
30-
replication: 2
31-
config:
32-
retention_bytes: -1
33-
retention_ms: 100000
25+
partitions: 3
26+
replication: 2
27+
config:
28+
retention_bytes: -1
29+
retention_ms: 100000
3430

3531
responses:
3632
'200':
@@ -53,6 +49,7 @@ responses:
5349

5450
x-codeSamples:
5551
- $ref: 'examples/curl/databases_update_topic.yml'
52+
- $ref: 'examples/go/databases_update_topic.yml'
5653

5754
security:
5855
- bearer_auth:

packages/openapi-typescript/examples/digital-ocean-api/resources/databases/databases_update_onlineMigration.yml

+17-16
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ tags:
1313
- Databases
1414

1515
parameters:
16-
- $ref: 'parameters.yml#/database_cluster_uuid'
16+
- $ref: "parameters.yml#/database_cluster_uuid"
1717

1818
requestBody:
1919
required: true
2020

2121
content:
2222
application/json:
2323
schema:
24-
$ref: 'models/source_database.yml'
24+
$ref: "models/source_database.yml"
2525

2626
example:
2727
source:
@@ -31,30 +31,31 @@ requestBody:
3131
username: doadmin
3232
password: paakjnfe10rsrsmf
3333
disable_ssl: false
34+
ignore_dbs: ["db0","db1"]
3435

3536
responses:
36-
'200':
37-
$ref: 'responses/online_migration.yml'
37+
"200":
38+
$ref: "responses/online_migration.yml"
3839

39-
'401':
40-
$ref: '../../shared/responses/unauthorized.yml'
40+
"401":
41+
$ref: "../../shared/responses/unauthorized.yml"
4142

42-
'404':
43-
$ref: '../../shared/responses/not_found.yml'
43+
"404":
44+
$ref: "../../shared/responses/not_found.yml"
4445

45-
'429':
46-
$ref: '../../shared/responses/too_many_requests.yml'
46+
"429":
47+
$ref: "../../shared/responses/too_many_requests.yml"
4748

48-
'500':
49-
$ref: '../../shared/responses/server_error.yml'
49+
"500":
50+
$ref: "../../shared/responses/server_error.yml"
5051

5152
default:
52-
$ref: '../../shared/responses/unexpected_error.yml'
53+
$ref: "../../shared/responses/unexpected_error.yml"
5354

5455
x-codeSamples:
55-
- $ref: 'examples/curl/databases_update_onlineMigration.yml'
56-
- $ref: 'examples/python/databases_update_onlineMigration.yml'
56+
- $ref: "examples/curl/databases_update_onlineMigration.yml"
57+
- $ref: "examples/python/databases_update_onlineMigration.yml"
5758

5859
security:
5960
- bearer_auth:
60-
- 'write'
61+
- "write"

packages/openapi-typescript/examples/digital-ocean-api/resources/databases/examples/curl/databases_create_cluster.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ source: |-
33
curl -X POST \
44
-H "Content-Type: application/json" \
55
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6-
-d '{"name": "backend", "engine": "pg", "version": "14", "region": "nyc3", "size": "db-s-2vcpu-4gb", "num_nodes": 2, "tags": ["production"]}' \
6+
-d '{"name": "backend", "engine": "pg", "version": "14", "region": "nyc3", "size": "db-s-2vcpu-4gb", "num_nodes": 2, "storage_size_mib": 61440, "tags": ["production"]}' \
77
"https://api.digitalocean.com/v2/databases"

packages/openapi-typescript/examples/digital-ocean-api/resources/databases/examples/curl/databases_create_replica.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ source: |-
33
curl -X POST \
44
-H "Content-Type: application/json" \
55
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6-
-d '{"name":"read-nyc3-01", "region":"nyc3", "size": "db-s-2vcpu-4gb"}' \
6+
-d '{"name":"read-nyc3-01", "region":"nyc3", "size": "db-s-2vcpu-4gb", "storage_size_mib": 61440}' \
77
"https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30/replicas"

packages/openapi-typescript/examples/digital-ocean-api/resources/databases/examples/curl/databases_update_clusterSize.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ source: |-
33
curl -X PUT \
44
-H "Content-Type: application/json" \
55
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6-
-d '{"size":"db-s-4vcpu-8gb", "num_nodes":3}' \
6+
-d '{"size":"db-s-4vcpu-8gb", "num_nodes":3, "storage_size_mib":163840}' \
77
"https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30/resize"

packages/openapi-typescript/examples/digital-ocean-api/resources/databases/examples/curl/databases_update_onlineMigration.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ source: |-
33
curl -X PUT \
44
-H "Content-Type: application/json" \
55
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6-
-d '{"source":{"host":"source-do-user-6607903-0.b.db.ondigitalocean.com","dbname":"defaultdb","port":25060,"username":"doadmin","password":"paakjnfe10rsrsmf"},"disable_ssl":false}' \
7-
"https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30/online-migration"
6+
-d '{"source":{"host":"source-do-user-6607903-0.b.db.ondigitalocean.com","dbname":"defaultdb","port":25060,"username":"doadmin","password":"paakjnfe10rsrsmf"},"disable_ssl":false,"ignore_dbs":["db0","db1"]}' \
7+
"https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30/online-migration"

packages/openapi-typescript/examples/digital-ocean-api/resources/databases/examples/curl/databases_update_topic.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ source: |-
33
curl -X PUT \
44
-H "Content-Type: application/json" \
55
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6-
-d '{"topic":{"name":"customer-events", "partition_count":3, "replication_factor": 3, "config": {"retentionMS": 1000000}}}' \
6+
-d '{"partition_count":3, "replication_factor": 3, "config": {"retentionMS": 1000000}}' \
77
"https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30/topics/customer-events"

packages/openapi-typescript/examples/digital-ocean-api/resources/databases/examples/go/databases_create_cluster.yml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ source: |-
2020
Region: "nyc3",
2121
SizeSlug: "db-s-2vcpu-4gb",
2222
NumNodes: 2,
23+
StorageSizeMiB : 61440,
2324
}
2425
2526
cluster, _, err := client.Databases.Create(ctx, createRequest)

packages/openapi-typescript/examples/digital-ocean-api/resources/databases/examples/go/databases_create_replica.yml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ source: |-
1818
Name: "read-nyc3-01",
1919
Region: "nyc3",
2020
Size: "db-s-2vcpu-4gb",
21+
StorageSizeMiB : 61440,
2122
}
2223
2324
replica, _, err := client.Databases.CreateReplica(ctx, "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30", replicaRequest)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
lang: Go
2+
source: |-
3+
import (
4+
"context"
5+
"os"
6+
7+
"github.com/digitalocean/godo"
8+
)
9+
10+
func main() {
11+
token := os.Getenv("DIGITALOCEAN_TOKEN")
12+
13+
client := godo.NewFromToken(token)
14+
ctx := context.TODO()
15+
16+
createRequest := &DatabaseCreateTopicRequest{
17+
Name: "events",
18+
PartitionCount: 3,
19+
ReplicationFactor: 2,
20+
Config: &TopicConfig{
21+
RetentionMS: 60000,
22+
}
23+
},
24+
25+
cluster, _, err := client.Databases.CreateTopic(ctx, "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30", createRequest)
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
lang: Go
2+
source: |-
3+
import (
4+
"context"
5+
"os"
6+
7+
"github.com/digitalocean/godo"
8+
)
9+
10+
func main() {
11+
token := os.Getenv("DIGITALOCEAN_TOKEN")
12+
13+
client := godo.NewFromToken(token)
14+
ctx := context.TODO()
15+
16+
topicName := "events"
17+
18+
_, err := client.Databases.DeleteTopic(ctx, "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30", topicName)
19+
}

0 commit comments

Comments
 (0)