oxidecomputer / oxidecomputer/omicron

[RFD322] Resource name selectors within request bodies

Open
#2,446 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api
Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Description

Some endpoints use resource name selectors within the request bodies like NetworkInterfaceCreate:

      "NetworkInterfaceCreate": {
        "description": "Create-time parameters for a [`NetworkInterface`](omicron_common::api::external::NetworkInterface)",
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "ip": {
            "nullable": true,
            "description": "The IP address for the interface. One will be auto-assigned if not provided.",
            "type": "string",
            "format": "ip"
          },
          "name": {
            "$ref": "#/components/schemas/Name"
          },
          "subnet_name": {
            "description": "The VPC Subnet in which to create the interface.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Name"
              }
            ]
          },
          "vpc_name": {
            "description": "The VPC in which to create the interface.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Name"
              }
            ]
          }
        },
        "required": [
          "description",
          "name",
          "subnet_name",
          "vpc_name"
        ]
      },

These request bodies create the same problems as using resource name identifiers in the paths. We should come up with a solution for these bodies as well. As we can't have queries within the request body JSON payload, it probably makes sense to use only the direct parent's UUID for these cases.

Open to discussing this if anyone has a different opinion though!

cc @ahl @zephraph @david-crespo

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the NetworkInterfaceCreate schema and the other request bodies that use resource name selectors. First understand how these selectors create the same problems as resource names in paths, then document the agreed solution for identifying direct parents and define what updated API schemas and behavior would demonstrate that the issue is resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.