Skip to content

docs: fix code samples and app spec schema errors - #1283

Open
dfinn5-do wants to merge 2 commits into
mainfrom
docs/fix-code-samples
Open

dfinn5-do wants to merge 2 commits into
mainfrom
docs/fix-code-samples

Conversation

@dfinn5-do

@dfinn5-do dfinn5-do commented Oct 23, 2026 •

Copy link
Copy Markdown

Fixes code samples and app spec schema errors that make examples on docs.digitalocean.com fail when copied or validated. Each change was checked against godo's generated app spec types.

Code samples

  • Droplets (curl, Go, Python, Ruby): replace size 1gb with s-2vcpu-4gb and images ubuntu-16-04-x64 and ubuntu-20-04-x64 with ubuntu-26-04-x64. Remove the enable_private_networking action from the curl and Ruby action samples.
  • Apps update (curl): wrap the body in {"spec": ...}, as the endpoint requires.
  • Apps get logs (curl, four samples): add the required type query parameter.

App spec schema

  • Add envs, alerts and features to app_spec, alerts to services, workers and jobs, and the SCHEDULED job kind with its schedule object.
  • Logtail destinations require token, not endpoint, which the schema never defined.
  • preserve_path_prefix on ingress rules is a boolean, as it already is on routes.

No endpoints added or removed. make lint: 0 errors, 8 existing warnings. With these changes, every app spec example in the docs validates.

Droplet samples referenced the retired 1gb size and ubuntu-16-04/20-04 images and the deprecated enable_private_networking action. The apps update sample omitted the spec wrapper and the log samples omitted the required type parameter.
@dfinn5-do dfinn5-do changed the title docs: use current slugs in droplet samples and fix app samples docs: fix code samples and app spec schema errors Nov 2, 2026

@kerickson-dot kerickson-dot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kerickson-dot

Copy link
Copy Markdown
Contributor

Two non-blocking notes, fine as a follow-up:

  1. A few copyable request examples still use retired images:

    • specification/resources/droplets/examples.yml (lines 6 and 27): the droplet create request-body examples still use ubuntu-20-04-x64, so the request panel on the docs page won't match the updated code samples.
    • specification/resources/autoscale_pools/examples/curl/autoscale_pool_create.yml and autoscale_pool_update.yml use ubuntu-20-04-x64.
    • The images_get samples (curl, Go, Ruby) fetch ubuntu-16-04-x64, which no longer resolves.

    Response examples can stay as they are.

  2. preserve_path_prefix changing from string to boolean is a type change for any client generated from the spec. Can you add a line about it to the PR description so the spec maintainers see it before merging?

@kerickson-dot kerickson-dot self-assigned this Nov 5, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants