Skip to content

docs: Add ADR 0042 - API standards for creating resources - #883

Closed
mike-gorman-bitwarden wants to merge 2 commits into
mainfrom
docs/adr-0042-api-standards-for-creating-resources
Closed

mike-gorman-bitwarden wants to merge 2 commits into
mainfrom
docs/adr-0042-api-standards-for-creating-resources

Conversation

@mike-gorman-bitwarden

@mike-gorman-bitwarden mike-gorman-bitwarden commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

🎟️ Tracking

Follow-up to ADR-0036 (#865).

📔 Objective

Adds ADR-0042, "API standards for creating resources", with status Proposed. Sets how resources are created: POST to the collection, omitting server-generated IDs, and 201/202/204 responses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Deploying contributing-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: efedc5f
Status: ✅  Deploy successful!
Preview URL: https://032509e4.contributing-docs.pages.dev
Branch Preview URL: https://docs-adr-0042-api-standards.contributing-docs.pages.dev

View logs

@rkac-bw

rkac-bw commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Idempotency for create. Service clients will retry (bounded retries with backoff), and a retried POST that succeeded the first time creates a duplicate. Either an Idempotency-Key header with a stated retention window, or client-generated IDs through PUT create-or-update, would make creates retry-safe. The ADR currently says nothing about this.

@mike-gorman-bitwarden

Copy link
Copy Markdown
Contributor Author

The standards already allow both forms of retry-safe create without a new header. Create-or-update through PUT with a client-chosen ID is covered (line 38, and ADR-0044), and PUT is idempotent. A POST can also carry a client-generated id, since id is only omitted when the service generates it, so a retry fails on the existing ID instead of creating a duplicate. Which creates need to be retry-safe is a decision for each API. I'd rather not adopt Idempotency-Key while it's still an IETF draft.

@mike-gorman-bitwarden
mike-gorman-bitwarden marked this pull request as ready for review October 14, 2026 09:10
@mike-gorman-bitwarden
mike-gorman-bitwarden requested a review from a team as a code owner October 14, 2026 09:10
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: REQUEST CHANGES

Reviewed the new ADR-0042 (docs/architecture/adr/0042-api-standards-for-creating-resources.md), which sets the method, path, request and success responses for creating resources. The frontmatter, tags and MADR structure follow the existing ADRs. ADRs 0039, 0040, 0044, 0045 and 0046 are cited in plain text without links; each one exists as a sibling branch in this series, so the docs build has no broken links. The idempotency discussion in the general comments already has a decision from the author and is not reopened here.

Code Review Details
  • ⚠️ : No Location header is required. A 204 for a server-generated ID leaves the caller unable to find the new resource, and a 201 without Location points at the collection under RFC 9110 §15.3.2.
    • docs/architecture/adr/0042-api-standards-for-creating-resources.md:39-45

Comment thread docs/architecture/adr/0042-api-standards-for-creating-resources.md
@mike-gorman-bitwarden

Copy link
Copy Markdown
Contributor Author

This PR is superseded by #894. We have done our best to retain/incorporate all feedback received to date.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants