Skip to content

API: 201 Created for new services #78

Closed

Description

@uniqueg

Why?

Some responses of the registry's write endpoints (cloud_registry/api/additions.openapi.yaml) don't follow HTTP semantics:

  • POST /services returns 200 with the new ID as body; a successful create should return 201 Created with a Location header pointing to /services/{serviceId}.
  • PUT /services/{serviceId} returns 200 both when it creates a new entry and when it replaces an existing one; clients cannot tell which happened. Creating should return 201.

This changes the API contract, so clients (in particular the ELIXIR Cloud UI) must be checked and updated at the same time. It is deliberately scheduled after #62, which already changes the write endpoints.

How?

  1. Spec (additions only): 201 with Location header for POST /services; 201 (created) and 200 (replaced) for PUT /services/{serviceId}. Keep the ID as response body for compatibility.
  2. Controllers: return the matching status and header; distinguish create from replace in PUT (replace_one(..., upsert=True) reports upserted_id).
  3. Tests for both cases (Tests: app-level test harness with fixtures #71).
  4. Check the UI and any scripts that call the API; note the change in the changelog/release notes.

Acceptance criteria

  • POST /services returns 201 with a Location header that resolves to the new entry.
  • PUT returns 201 on create and 200 on replace.
  • The UI works with the new responses.

Dependencies: #62; #71. Breaking change.

Activity

  1. added
    priority: low
    type flag: breaking change
    type flag: spec change
    type: feature
    workload: hours
    on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: lowtype flag: breaking changetype flag: spec changetype: featureworkload: hours

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions