Skip to content

docs(web-server-schema): call out OpenAPI 3.0.x requirement and add 3.1 to 3.0 migration page#2734

Draft
DaveHanns wants to merge 1 commit into
masterfrom
docs/standby-openapi-3-gotchas
Draft

docs(web-server-schema): call out OpenAPI 3.0.x requirement and add 3.1 to 3.0 migration page#2734
DaveHanns wants to merge 1 commit into
masterfrom
docs/standby-openapi-3-gotchas

Conversation

@DaveHanns

Copy link
Copy Markdown
Contributor

Summary

  • Update the web server schema landing page to state OpenAPI 3.0.x explicitly (the build validator rejects 3.1) and link to a new compatibility page.
  • Add a new page under the web server schema section that lists common OpenAPI 3.1 constructs that break the build alongside the 3.0.x form to use instead, with a full nullable example and two local validation commands.

Motivation

webServerSchema in .actor/actor.json is validated against OpenAPI 3.0.x at build time. The current docs describe the field as accepting "OpenAPI 3.x" and link out to the 3.0.3 spec, but never state that 3.1 is not accepted. Users who copy an existing spec generated by a tool that defaults to 3.1 - or hand-write one using the 3.1 nullable form "type": ["string", "null"] - see the build fail with a validation error that gives no hint about the version constraint or how to fix it.

Evidence

Minimal reproducer - an .actor/openapi.json that is valid OpenAPI 3.1 but uses only 3.1-specific syntax:

{
    "openapi": "3.1.0",
    "info": { "title": "My API Actor", "version": "1.0.0" },
    "paths": {
        "/items": {
            "get": {
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "name": { "type": ["string", "null"] }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

apify push triggers a build that fails validation of webServerSchema with no indication that the root cause is the OpenAPI version. The existing docs at /platform/actors/development/actor-definition/web-server-schema do not mention the constraint, so there is no obvious next step for the user other than trial-and-error.

Changes

  • sources/platform/actors/development/actor_definition/web_server_schema/index.md: replace two "OpenAPI 3.x" mentions with "OpenAPI 3.0.x", and link to the new compatibility page from both the intro and the "Define the web server schema" section.
  • sources/platform/actors/development/actor_definition/web_server_schema/openapi_version.md (new): explains the version constraint, shows the correct nullable: true form, includes a table of common 3.1 to 3.0 translations (nullable, exclusiveMinimum/exclusiveMaximum, const, examples, $schema, webhooks, contentMediaType), a full nullable example, and two local validation commands (@redocly/cli and @apidevtools/swagger-cli).

Test plan

  • pnpm start renders the new page under Web server schema in the sidebar.
  • Both links added to the landing page resolve to the new page.
  • The nullable JSON example on the new page validates against OpenAPI 3.0.3 with npx @redocly/cli lint.

Surfaced during an evaluation of Apify surfaces for agent-driven Actor development.

….1 to 3.0 migration page

The `webServerSchema` build validator rejects OpenAPI 3.1 documents,
but the current docs say "OpenAPI 3.x" and link to the 3.0.3 spec
without stating that 3.1 is unsupported. Users who copy a 3.1 spec
(for example, one that uses `"type": ["string", "null"]` for nullable
properties) hit an opaque build validation error with no pointer to
the fix.

This change:

- Updates the web server schema landing page to say OpenAPI 3.0.x
  explicitly and link to the new compatibility page.
- Adds a new page under the web server schema section that lists the
  common 3.1 constructs that break the build (`type` array with
  `"null"`, `const`, numeric `exclusiveMinimum`/`exclusiveMaximum`,
  top-level `webhooks`, `contentMediaType`) alongside the 3.0.x form
  to use instead, plus a full nullable example and two local
  validation commands.

Surfaced during an evaluation of Apify surfaces for agent-driven Actor development.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@apify-service-account

apify-service-account commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

✅ Preview for this PR (commit f937a04) is ready at https://pr-2734.preview.docs.apify.com (see action run).

@DaveHanns DaveHanns marked this pull request as draft July 5, 2026 11:21
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