Skip to content

Fix security.txt API field name docs#28139

Merged
caley-b merged 1 commit intoproductionfrom
opencode/issue27994-20260206112722
Feb 13, 2026
Merged

Fix security.txt API field name docs#28139
caley-b merged 1 commit intoproductionfrom
opencode/issue27994-20260206112722

Conversation

@ask-bonk
Copy link
Contributor

@ask-bonk ask-bonk bot commented Feb 6, 2026

Here's a summary of the investigation and fix:

Analysis

Validation against RFC 9116

The security.txt specification (RFC 9116, Section 2.5.8) defines the field as Preferred-Languages (hyphenated). This is the field name used in the actual .well-known/security.txt file format. For the JSON API representation, Cloudflare's API uses snake_case convention.

Validation against the actual API endpoint

The issue reporter's curl response confirms the API returns preferred_languages (snake_case):

"preferred_languages": "en, de"

What's wrong in the current docs

The auto-generated API reference at /api/resources/security_txt/ shows preferredLanguages (camelCase) in both the GET response and PUT request examples. This comes from the OpenAPI schema in the external cloudflare/api-schemas repo (commit f472d1636b1d5956c87cd02cfed0cf3e37b9a39f), which defines the property as preferredLanguages. The latest commit (2548aabddafdfd002db9789ca16b6b2c7502daba, Feb 3 2026) still has this bug.

What was fixed

The API reference pages are auto-generated from the external cloudflare/api-schemas repository and cannot be corrected in this docs repo (no local override mechanism exists). The root fix needs to happen in cloudflare/api-schemas by renaming preferredLanguages to preferred_languages in the security-center_securityTxt schema.

What I did fix in this PR:

  • Added a note to src/content/docs/security-center/infrastructure/security-file.mdx documenting that the correct API field name is preferred_languages (snake_case)
  • Added a link to the API reference from the docs page (previously missing)

The upstream OpenAPI schema fix in cloudflare/api-schemas should be filed separately to correct the auto-generated API reference.

Closes #27994

github run

Co-authored-by: elithrar <elithrar@users.noreply.github.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/security-center/ @cloudflare/pcx-technical-writing

@elithrar
Copy link
Collaborator

elithrar commented Feb 6, 2026

@KaydeeDee see the notes here. Stainless is generating an incorrect schema.

@caley-b caley-b merged commit b785b05 into production Feb 13, 2026
12 checks passed
@caley-b caley-b deleted the opencode/issue27994-20260206112722 branch February 13, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

security.txt API endpoint documentation incorrect

2 participants