Skip to content

Fix defaultNonNullable behavior #1445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 19, 2023
Merged
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
307 changes: 275 additions & 32 deletions packages/openapi-typescript/examples/digital-ocean-api.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,18 @@ paths:
get:
$ref: 'resources/monitoring/monitoring_get_dropletMemoryAvailableMetrics.yml'

/v2/monitoring/metrics/apps/memory_percentage:
get:
$ref: 'resources/monitoring/monitoring_get_appMemoryPercentageMetrics.yml'

/v2/monitoring/metrics/apps/cpu_percentage:
get:
$ref: 'resources/monitoring/monitoring_get_appCPUPercentageMetrics.yml'

/v2/monitoring/metrics/apps/restart_count:
get:
$ref: 'resources/monitoring/monitoring_get_appRestartCountMetrics.yml'

/v2/projects:
get:
$ref: 'resources/projects/projects_list.yml'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@

type: object
properties:

cors:
$ref: apps_cors_policy.yml
allOf:
- $ref: apps_cors_policy.yml
- description: (Deprecated - Use Ingress Rules instead).
- deprecated: true

routes:
type: array
description: A list of HTTP routes that should be routed to this component.
description: (Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
deprecated: true
items:
$ref: app_route_spec.yml

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ title: A criterion for routing HTTP traffic to a component.
type: object
properties:
path:
description: An HTTP path prefix. Paths must start with / and must be unique across
description: (Deprecated - Use Ingress Rules instead). An HTTP path prefix. Paths must start with / and must be unique across
all components within an app.
type: string
example: /api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ allOf:
- type: object
properties:
cors:
$ref: apps_cors_policy.yml
allOf:
- $ref: apps_cors_policy.yml
- description: (Deprecated - Use Ingress Rules instead).
- deprecated: true

health_check:
$ref: app_service_spec_health_check.yml
Expand All @@ -32,7 +35,8 @@ allOf:

routes:
type: array
description: A list of HTTP routes that should be routed to this component.
description: (Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
deprecated: true
items:
$ref: app_route_spec.yml

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ allOf:
example: dist/

cors:
$ref: apps_cors_policy.yml
allOf:
- $ref: apps_cors_policy.yml
- description: (Deprecated - Use Ingress Rules instead).
- deprecated: true

routes:
type: array
items:
$ref: app_route_spec.yml
description: A list of HTTP routes that should be routed to this component.
description: (Deprecated - Use Ingress Rules instead). A list of HTTP routes that should be routed to this component.
deprecated: true

required:
- name
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ properties:

tag:
type: string
description: The repository tag. Defaults to `latest` if not provided.
description: The repository tag. Defaults to `latest` if not provided and no digest is provided. Cannot be specified if digest is provided.
example: latest
default: latest

digest:
type: string
description: The image digest. Cannot be specified if tag is provided.
example: sha256:795e91610e9cccb7bb80893fbabf9c808df7d52ae1f39cd1158618b4a33041ac

deploy_on_push:
type: object
properties:
enabled:
type: boolean
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.
example: true
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,11 @@ requestBody:
name: app-03
settings:
acl:
- id: acl128aaaa99239
permission: produceconsume
- permission: produceconsume
topic: customer-events
- id: acl293098flskdf
permission: produce
- permission: produce
topic: customer-events.*
- id: acl128ajei20123
permission: consume
- permission: consume
topic: customer-events

responses:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ requestBody:
version: "14"
region: nyc3
size: db-s-2vcpu-4gb
storage_size_mib: 61440
num_nodes: 2
tags:
- production
Expand All @@ -57,6 +58,7 @@ requestBody:
region: nyc3
size: db-s-2vcpu-4gb
num_nodes: 2
storage_size_mib: 61440
tags:
- production
rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ responses:

x-codeSamples:
- $ref: 'examples/curl/databases_create_topic.yml'
- $ref: 'examples/go/databases_create_topic.yml'

security:
- bearer_auth:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ requestBody:
name: read-nyc3-01
region: nyc3
size: db-s-2vcpu-4gb
storage_size_mib: 61440

responses:
'201':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ responses:

x-codeSamples:
- $ref: 'examples/curl/databases_delete_topic.yml'
- $ref: 'examples/go/databases_delete_topic.yml'

security:
- bearer_auth:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ responses:

x-codeSamples:
- $ref: 'examples/curl/databases_get_topic.yml'
- $ref: 'examples/go/databases_get_topic.yml'

security:
- bearer_auth:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ responses:

x-codeSamples:
- $ref: 'examples/curl/databases_list_topics.yml'
- $ref: 'examples/go/databases_list_topics.yml'

security:
- bearer_auth:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ requestBody:
example:
size: db-s-4vcpu-8gb
num_nodes: 3
storage_size_mib: 163840

responses:
'202':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,12 @@ requestBody:
schema:
allOf:
- $ref: 'models/kafka_topic_update.yml'
required:
- topic
example:
topic:
name: customer-events
partitions: 3
replication: 2
config:
retention_bytes: -1
retention_ms: 100000
partitions: 3
replication: 2
config:
retention_bytes: -1
retention_ms: 100000

responses:
'200':
Expand All @@ -53,6 +49,7 @@ responses:

x-codeSamples:
- $ref: 'examples/curl/databases_update_topic.yml'
- $ref: 'examples/go/databases_update_topic.yml'

security:
- bearer_auth:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ tags:
- Databases

parameters:
- $ref: 'parameters.yml#/database_cluster_uuid'
- $ref: "parameters.yml#/database_cluster_uuid"

requestBody:
required: true

content:
application/json:
schema:
$ref: 'models/source_database.yml'
$ref: "models/source_database.yml"

example:
source:
Expand All @@ -31,30 +31,31 @@ requestBody:
username: doadmin
password: paakjnfe10rsrsmf
disable_ssl: false
ignore_dbs: ["db0","db1"]

responses:
'200':
$ref: 'responses/online_migration.yml'
"200":
$ref: "responses/online_migration.yml"

'401':
$ref: '../../shared/responses/unauthorized.yml'
"401":
$ref: "../../shared/responses/unauthorized.yml"

'404':
$ref: '../../shared/responses/not_found.yml'
"404":
$ref: "../../shared/responses/not_found.yml"

'429':
$ref: '../../shared/responses/too_many_requests.yml'
"429":
$ref: "../../shared/responses/too_many_requests.yml"

'500':
$ref: '../../shared/responses/server_error.yml'
"500":
$ref: "../../shared/responses/server_error.yml"

default:
$ref: '../../shared/responses/unexpected_error.yml'
$ref: "../../shared/responses/unexpected_error.yml"

x-codeSamples:
- $ref: 'examples/curl/databases_update_onlineMigration.yml'
- $ref: 'examples/python/databases_update_onlineMigration.yml'
- $ref: "examples/curl/databases_update_onlineMigration.yml"
- $ref: "examples/python/databases_update_onlineMigration.yml"

security:
- bearer_auth:
- 'write'
- "write"
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ source: |-
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"name": "backend", "engine": "pg", "version": "14", "region": "nyc3", "size": "db-s-2vcpu-4gb", "num_nodes": 2, "tags": ["production"]}' \
-d '{"name": "backend", "engine": "pg", "version": "14", "region": "nyc3", "size": "db-s-2vcpu-4gb", "num_nodes": 2, "storage_size_mib": 61440, "tags": ["production"]}' \
"https://api.digitalocean.com/v2/databases"
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ source: |-
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"name":"read-nyc3-01", "region":"nyc3", "size": "db-s-2vcpu-4gb"}' \
-d '{"name":"read-nyc3-01", "region":"nyc3", "size": "db-s-2vcpu-4gb", "storage_size_mib": 61440}' \
"https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30/replicas"
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ source: |-
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"size":"db-s-4vcpu-8gb", "num_nodes":3}' \
-d '{"size":"db-s-4vcpu-8gb", "num_nodes":3, "storage_size_mib":163840}' \
"https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30/resize"
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ source: |-
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"source":{"host":"source-do-user-6607903-0.b.db.ondigitalocean.com","dbname":"defaultdb","port":25060,"username":"doadmin","password":"paakjnfe10rsrsmf"},"disable_ssl":false}' \
"https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30/online-migration"
-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"]}' \
"https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30/online-migration"
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ source: |-
curl -X PUT \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"topic":{"name":"customer-events", "partition_count":3, "replication_factor": 3, "config": {"retentionMS": 1000000}}}' \
-d '{"partition_count":3, "replication_factor": 3, "config": {"retentionMS": 1000000}}' \
"https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30/topics/customer-events"
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ source: |-
Region: "nyc3",
SizeSlug: "db-s-2vcpu-4gb",
NumNodes: 2,
StorageSizeMiB : 61440,
}

cluster, _, err := client.Databases.Create(ctx, createRequest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ source: |-
Name: "read-nyc3-01",
Region: "nyc3",
Size: "db-s-2vcpu-4gb",
StorageSizeMiB : 61440,
}

replica, _, err := client.Databases.CreateReplica(ctx, "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30", replicaRequest)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
lang: Go
source: |-
import (
"context"
"os"

"github.com/digitalocean/godo"
)

func main() {
token := os.Getenv("DIGITALOCEAN_TOKEN")

client := godo.NewFromToken(token)
ctx := context.TODO()

createRequest := &DatabaseCreateTopicRequest{
Name: "events",
PartitionCount: 3,
ReplicationFactor: 2,
Config: &TopicConfig{
RetentionMS: 60000,
}
},

cluster, _, err := client.Databases.CreateTopic(ctx, "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30", createRequest)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
lang: Go
source: |-
import (
"context"
"os"

"github.com/digitalocean/godo"
)

func main() {
token := os.Getenv("DIGITALOCEAN_TOKEN")

client := godo.NewFromToken(token)
ctx := context.TODO()

topicName := "events"

_, err := client.Databases.DeleteTopic(ctx, "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30", topicName)
}
Loading