feat: extend specs with create/update/remove types - #13
Draft
Koan-Bot wants to merge 1 commit into
Draft
Conversation
The specs system previously only generated GET-based methods (listable and getfromid types), forcing all POST/PUT/DELETE operations to be hardcoded in service classes. This adds three new spec types: - create: POST with resource key wrapping/unwrapping - update: PUT with UID substitution and resource wrapping - remove: DELETE with UID substitution Migrates hardcoded methods to spec-generated ones: - Compute::create_server → specs (create type) - Network::create_floating_ip → specs (create type) - Network::delete_floatingip → specs (remove type) - Adds update_floatingip, update_port, delete_server_from_uid Also implements proper post/put/delete accessors on the Specs role (previously stubs that died) and adds _resolve_uri helper to handle version-prefixed routes correctly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extends the specs system to generate POST, PUT, and DELETE methods from YAML declarations — not just GET.
Why
The specs system could only generate
listable(GET list) andgetfromid(GET by ID) methods. All write operations (create_server,create_floating_ip,delete_floatingip) were hardcoded in service classes, defeating the purpose of declarative API specs. This was the #1 architectural limitation noted in multiple FIXMEs.How
Three new spec types in
Specs::Roles::Service:create: POST withresource_keywrapping (body:{server: {...}}, response unwrap)update: PUT with UID template substitution + resource wrappingremove: DELETE with UID template substitutionA
_resolve_urihelper handles the version-prefix doubling issue (Network routes include/v2.0/whileroot_uri()also prepends it).Migrated 3 hardcoded methods to specs, added 3 new spec-generated methods (
update_floatingip,update_port,delete_server_from_uid).Testing
t/specs-crud.tcovering each type for both Compute and Network services🤖 Generated with Claude Code
Quality Report
Changes: 8 files changed, 363 insertions(+), 48 deletions(-)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline