Skip to content

Align write endpoints with spec: use request-body DTOs instead of path variables #128

Description

@dmccoystephenson

Summary

The write endpoints accept their inputs as path variables rather than request bodies, which diverges from docs/MVP.md and docs/openapi/viron-api.json. No controller currently uses @RequestBody.

Spec vs. implementation

Operation Spec (MVP.md / OpenAPI) Implemented
Create entity POST /api/v1/entities with body POST /api/v1/entities/{name} (path var)
Create environment body CreateEnvironmentRequest POST /api/v1/environments/{name}/{numGrids}/{gridSize} (path vars)
Rename environment body UpdateEnvironmentNameRequest PATCH /api/v1/environments/{id}/name/{name} (path var)

As a consequence, the two request DTOs named in MVP.md — CreateEnvironmentRequest and UpdateEnvironmentNameRequest — were never created (dto/ holds only response DTOs).

Proposed work

  • Add CreateEnvironmentRequest and UpdateEnvironmentNameRequest DTOs with bean validation.
  • Accept request bodies on the create/rename/create-entity endpoints (a CreateEntityRequest may be warranted).
  • Decide whether the path-variable forms are kept for backward compatibility or removed; update docs/openapi/viron-api.json either way so spec and code agree.

Notes

A decision is needed on whether the spec or the current path-variable behaviour is authoritative; this issue assumes the spec is.


Filed by Claude on behalf of Daniel Stephenson.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions