Skip to content
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

Fix handling of nullable schemas #1959

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
640 changes: 604 additions & 36 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 @@ -23,7 +23,7 @@ tags:
description: |-
1-Click applications are pre-built Droplet images or Kubernetes apps with software,
features, and configuration details already set up for you. They can be found in the
[DigitalOcean Marketplace](https://www.digitalocean.com/docs/marketplace).
[DigitalOcean Marketplace](https://marketplace.digitalocean.com/).

- name: Account
description: Provides information about your current account.
Expand Down Expand Up @@ -66,7 +66,7 @@ tags:
**Balance:** By sending requests to the `/v2/customers/my/balance` endpoint, you can
retrieve the balance information for the requested customer account.

**Invoices:** [Invoices](https://www.digitalocean.com/docs/accounts/billing/invoices/)
**Invoices:** [Invoices](https://docs.digitalocean.com/platform/billing/invoices/)
are generated on the first of each month for every DigitalOcean
customer. An invoice preview is generated daily, which can be accessed
with the `preview` keyword in place of `$INVOICE_UUID`. To interact with
Expand All @@ -81,7 +81,7 @@ tags:

- name: Block Storage
description: |-
[DigitalOcean Block Storage Volumes](https://www.digitalocean.com/docs/volumes/)
[DigitalOcean Block Storage Volumes](https://docs.digitalocean.com/products/volumes/)
provide expanded storage capacity for your Droplets and can be moved
between Droplets within a specific region.

Expand All @@ -106,18 +106,20 @@ tags:
- name: CDN Endpoints
description: |-
Content hosted in DigitalOcean's object storage solution,
[Spaces](https://www.digitalocean.com/docs/spaces/overview/),
[Spaces](https://docs.digitalocean.com/products/spaces/),
can optionally be served by our globally distributed Content Delivery
Network (CDN). By sending requests to `/v2/cdn/endpoints`, you can list,
create, or delete CDN Endpoints as well as purge cached content. To use a
custom subdomain to access the CDN Endpoint, provide the ID of a
DigitalOcean managed TLS certificate and the fully qualified domain name
for the custom subdomain.
for the custom subdomain.

CDN endpoints have a rate limit of five requests per 10 seconds.

- name: Certificates
description: |-
In order to perform SSL termination on load balancers, DigitalOcean offers
two types of [SSL certificate management](https://www.digitalocean.com/docs/accounts/security/#certificates):
two types of [SSL certificate management](https://docs.digitalocean.com/platform/teams/manage-certificates):

* **Custom**: User-generated certificates may be uploaded to DigitalOcean
where they will be placed in a fully encrypted and isolated storage system.
Expand All @@ -130,7 +132,7 @@ tags:
- name: Container Registry
description: |-
DigitalOcean offers the ability for you to create a
[private container registry](https://www.digitalocean.com/docs/images/container-registry/quickstart/)
[private container registry](https://docs.digitalocean.com/products/container-registry/)
to store your Docker images for use with your Kubernetes clusters. This
container registry runs inside the same datacenters as your cluster,
ensuring reliable and performant rollout of image deployments.
Expand All @@ -140,12 +142,12 @@ tags:

- name: Databases
description: |-
DigitalOcean's [managed database service](https://www.digitalocean.com/docs/databases)
DigitalOcean's [managed database service](https://docs.digitalocean.com/products/databases)
simplifies the creation and management of highly available database clusters. Currently, it
offers support for [PostgreSQL](http://www.digitalocean.com/docs/databases/postgresql/),
[Redis](https://www.digitalocean.com/docs/databases/redis/),
[MySQL](https://www.digitalocean.com/docs/databases/mysql/),
[MongoDB](https://www.digitalocean.com/docs/databases/mongodb/), and
offers support for [PostgreSQL](http://docs.digitalocean.com/products/databases/postgresql/),
[Redis](https://docs.digitalocean.com/products/databases/redis/),
[MySQL](https://docs.digitalocean.com/products/databases/mysql/),
[MongoDB](https://docs.digitalocean.com/products/databases/mongodb/), and
[OpenSearch](https://docs.digitalocean.com/products/databases/opensearch/).

By sending requests to the `/v2/databases` endpoint, you can list, create, or delete
Expand All @@ -170,7 +172,7 @@ tags:
and manage DNS zone files by adding and modifying individual records for a
domain.

The [DigitalOcean DNS management interface](https://www.digitalocean.com/docs/networking/dns/)
The [DigitalOcean DNS management interface](https://docs.digitalocean.com/products/networking/dns/)
allows you to configure the following DNS records:

Name | Description |
Expand All @@ -189,7 +191,7 @@ tags:
description: |-
Domain resources are domain names that you have purchased from a domain
name registrar that you are managing through the
[DigitalOcean DNS interface](https://www.digitalocean.com/docs/networking/dns/).
[DigitalOcean DNS interface](https://docs.digitalocean.com/products/networking/dns/).

This resource establishes top-level control over each domain. Actions that
affect individual domain records should be taken on the
Expand Down Expand Up @@ -217,7 +219,7 @@ tags:

- name: Droplets
description: |-
A [Droplet](https://www.digitalocean.com/docs/droplets/) is a DigitalOcean
A [Droplet](https://docs.digitalocean.com/products/droplets/) is a DigitalOcean
virtual machine. By sending requests to the Droplet endpoint, you can
list, create, or delete Droplets.

Expand All @@ -228,7 +230,7 @@ tags:

- name: Firewalls
description: |-
[DigitalOcean Cloud Firewalls](https://www.digitalocean.com/docs/networking/firewalls/)
[DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/)
provide the ability to restrict network access to and from a Droplet
allowing you to define which ports will accept inbound or outbound
connections. By sending requests to the `/v2/firewalls` endpoint, you can
Expand Down Expand Up @@ -271,7 +273,7 @@ tags:
will contain the field `reserved_ips` in addition to the `floating_ips` field.
Floating IPs retrieved using the Projects API will retain the original name.

[DigitalOcean Floating IPs](https://www.digitalocean.com/docs/networking/floating-ips/)
[DigitalOcean Floating IPs](https://docs.digitalocean.com/products/networking/reserved-ips/)
are publicly-accessible static IP addresses that can be mapped to one of
your Droplets. They can be used to create highly available setups or other
configurations requiring movable addresses.
Expand All @@ -296,34 +298,34 @@ tags:

- name: Images
description: |-
A DigitalOcean [image](https://www.digitalocean.com/docs/images/) can be
A DigitalOcean [image](https://docs.digitalocean.com/products/images/) can be
used to create a Droplet and may come in a number of flavors. Currently,
there are five types of images: snapshots, backups, applications,
distributions, and custom images.

* [Snapshots](https://www.digitalocean.com/docs/images/snapshots/) provide
* [Snapshots](https://docs.digitalocean.com/products/snapshots/) provide
a full copy of an existing Droplet instance taken on demand.

* [Backups](https://www.digitalocean.com/docs/images/backups/) are similar
* [Backups](https://docs.digitalocean.com/products/backups/) are similar
to snapshots but are created automatically at regular intervals when
enabled for a Droplet.

* [Custom images](https://www.digitalocean.com/docs/images/custom-images/)
* [Custom images](https://docs.digitalocean.com/products/custom-images/)
are Linux-based virtual machine images (raw, qcow2, vhdx, vdi, and vmdk
formats are supported) that you may upload for use on DigitalOcean.

* Distributions are the public Linux distributions that are available to
be used as a base to create Droplets.

* Applications, or [1-Click Apps](https://www.digitalocean.com/docs/one-clicks/),
* Applications, or [1-Click Apps](https://docs.digitalocean.com/products/marketplace/),
are distributions pre-configured with additional software.

To interact with images, you will generally send requests to the images
endpoint at /v2/images.

- name: Kubernetes
description: |-
[DigitalOcean Kubernetes](https://www.digitalocean.com/docs/kubernetes/)
[DigitalOcean Kubernetes](https://docs.digitalocean.com/products/kubernetes/)
allows you to quickly deploy scalable and secure Kubernetes clusters. By
sending requests to the `/v2/kubernetes/clusters` endpoint, you can list,
create, or delete clusters as well as scale node pools up and down,
Expand All @@ -332,7 +334,7 @@ tags:

- name: Load Balancers
description: |-
[DigitalOcean Load Balancers](https://www.digitalocean.com/docs/networking/load-balancers/)
[DigitalOcean Load Balancers](https://docs.digitalocean.com/products/networking/load-balancers/)
provide a way to distribute traffic across multiple Droplets. By sending
requests to the `/v2/load_balancers` endpoint, you can list, create, or
delete load balancers as well as add or remove Droplets, forwarding rules,
Expand Down Expand Up @@ -449,7 +451,7 @@ tags:

- name: Snapshots
description: |-
[Snapshots](https://www.digitalocean.com/docs/images/snapshots/) are saved
[Snapshots](https://docs.digitalocean.com/products/snapshots/) are saved
instances of a Droplet or a block storage volume, which is reflected in
the `resource_type` attribute. In order to avoid problems with compressing
filesystems, each defines a `min_disk_size` attribute which is the minimum
Expand Down Expand Up @@ -478,9 +480,16 @@ tags:

To interact with Uptime, you will generally send requests to the Uptime endpoint at `/v2/uptime/`.

- name: VPC Peerings
description: |-
[VPC Peerings](https://docs.digitalocean.com/products/networking/vpc/how-to/create-peering/)
join two VPC networks with a secure, private connection. This allows
resources in those networks to connect to each other's private IP addresses
as if they were in the same network.

- name: VPCs
description: |-
[VPCs (virtual private clouds)](https://www.digitalocean.com/docs/networking/vpc/)
[VPCs (virtual private clouds)](https://docs.digitalocean.com/products/networking/vpc/)
allow you to create virtual networks containing resources that can
communicate with each other in full isolation using private IP addresses.

Expand Down Expand Up @@ -1635,6 +1644,33 @@ paths:
get:
$ref: 'resources/vpcs/vpcs_list_members.yml'

/v2/vpcs/{vpc_id}/peerings:
get:
$ref: 'resources/vpcs/vpcs_list_peerings.yml'

post:
$ref: 'resources/vpcs/vpcs_create_peerings.yml'

/v2/vpcs/{vpc_id}/peerings/{vpc_peering_id}:
patch:
$ref: 'resources/vpcs/vpcs_update_peerings.yml'

/v2/vpc_peerings:
get:
$ref: 'resources/vpc_peerings/vpc_peerings_list.yml'

post:
$ref: 'resources/vpc_peerings/vpc_peerings_create.yml'

/v2/vpc_peerings/{vpc_peering_id}:
get:
$ref: 'resources/vpc_peerings/vpc_peerings_get.yml'

patch:
$ref: 'resources/vpc_peerings/vpc_peerings_update.yml'

delete:
$ref: 'resources/vpc_peerings/vpc_peerings_delete.yml'

/v2/uptime/checks:
get:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ properties:
$ref: '../../regions/models/region.yml'

region_slug:
allOf:
- $ref: '../../regions/models/region.yml#/properties/slug'
- type: string
nullable: true
type: string
nullable: true
description: A human-readable string that is used as a unique identifier
for each region.
example: nyc3
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ properties:
environment_slug:
type: string
description: An environment slug describing the type of this app. For a full list,
please refer to [the product documentation](https://www.digitalocean.com/docs/app-platform/).
please refer to [the product documentation](https://docs.digitalocean.com/products/app-platform/).
example: node-js

log_destinations:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: object
description: Specification to configure maintenance settings for the app, such as maintenance mode.
properties:
enabled:
type: boolean
description: Indicates whether maintenance mode should be enabled for the app.
example: true
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ allOf:
health_check:
$ref: app_service_spec_health_check.yml

protocol:
type: string
description: |
The protocol which the service uses to serve traffic on the http_port.

- `HTTP`: The app is serving the HTTP protocol. Default.
- `HTTP2`: The app is serving the HTTP/2 protocol. Currently, this needs to be implemented in the service by serving HTTP/2 cleartext (h2c).
enum:
- HTTP
- HTTP2
example: HTTP

http_port:
type: integer
description: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,8 @@ properties:
egress:
$ref: app_egress_spec.yml

maintenance:
$ref: app_maintenance_spec.yml

required:
- name
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ description: |
`/v2/cdn/endpoints/$ENDPOINT_ID/cache`. The body of the request should include
a `files` attribute containing a list of cached file paths to be purged. A
path may be for a single file or may contain a wildcard (`*`) to recursively
purge all files under a directory. When only a wildcard is provided, all
cached files will be purged. There is a rate limit of 50 files per 20 seconds
that can be purged.
purge all files under a directory. When only a wildcard is provided, all cached
files will be purged. There is a rate limit of 50 files per 20 seconds that can
be purged. CDN endpoints have a rate limit of 5 requests per 10 seconds.
Purging files using a wildcard path counts as a single request against the API's
rate limit. Two identical purge requests cannot be sent at the same time.

tags:
- CDN Endpoints
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ x-codeSamples:

security:
- bearer_auth:
- 'cdn:read'
- 'certificate:read'

Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ x-codeSamples:

security:
- bearer_auth:
- 'cdn:read'
- 'certificate:read'
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ summary: Add a New Connection Pool (PostgreSQL)
description: |
For PostgreSQL database clusters, connection pools can be used to allow a
database to share its idle connections. The popular PostgreSQL connection
pooling utility PgBouncer is used to provide this service. [See here for more information](https://www.digitalocean.com/docs/databases/postgresql/how-to/manage-connection-pools/)
pooling utility PgBouncer is used to provide this service. [See here for more information](https://docs.digitalocean.com/products/databases/postgresql/how-to/manage-connection-pools/)
about how and why to use PgBouncer connection pooling including
details about the available transaction modes.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: >-
provided, any Droplet or Kubernetes node with that tag applied to it will
have access. The firewall is limited to 100 rules (or trusted sources). When
possible, we recommend
[placing your databases into a VPC network](https://www.digitalocean.com/docs/networking/vpc/)
[placing your databases into a VPC network](https://docs.digitalocean.com/products/networking/vpc/)
to limit access to them instead of using a firewall.

A successful
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ properties:
type: integer
example: 2500000
minimum: 1
maximum: 9223372036854776000
maximum: 9223372036854775807
default: 2500000
ism_history_rollover_check_period_hours:
description: >-
Expand Down Expand Up @@ -269,7 +269,7 @@ properties:
default: use-context
cluster_routing_allocation_node_concurrent_recoveries:
description: >-
Maximum concurrent incoming/outgoing shard recoveries (normally replicas) are allowed to happen per node .
Maximum concurrent incoming/outgoing shard recoveries (normally replicas) are allowed to happen per node .
type: integer
example: 2
minimum: 2
Expand All @@ -279,6 +279,12 @@ properties:
description: >-
Allowlist of remote IP addresses for reindexing. Changing this value will cause all OpenSearch instances to restart.
type: array
items:
items:
type: string
example: ["255.255.223.233:9200", "222.33.222.222:6300"]
example: ["255.255.223.233:9200", "222.33.222.222:6300"]
plugins_alerting_filter_by_backend_roles_enabled:
description: >-
Enable or disable filtering of alerting by backend roles.
type: boolean
example: false
default: false
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ description: |
parameter set to the name of the tag in your GET request. For example,
`/v2/droplets?tag_name=$TAG_NAME`.

### GPU Droplets

By default, only non-GPU Droplets are returned. To list only GPU Droplets, set
the `type` query parameter to `gpus`. For example, `/v2/droplets?type=gpus`.

tags:
- Droplets

Expand All @@ -24,6 +29,7 @@ parameters:
- $ref: '../../shared/parameters.yml#/page'
- $ref: 'parameters.yml#/droplet_tag_name'
- $ref: 'parameters.yml#/droplet_name'
- $ref: 'parameters.yml#/droplet_type'

responses:
'200':
Expand Down
Loading
Loading