feat(rest): generated fabric address-management resources (client.fabric.*) — phase 1#70
Draft
mjerris wants to merge 1 commit into
Draft
feat(rest): generated fabric address-management resources (client.fabric.*) — phase 1#70mjerris wants to merge 1 commit into
mjerris wants to merge 1 commit into
Conversation
…ic.*) Phase 1 (python-first) of the fabric address-management REST rollout. All generated files were produced by porting-sdk's generate_python_rest_types.py against the reshaped rest-apis/fabric-addresses/openapi.yaml — NOT hand-written (they carry the AUTO-GENERATED ... DO NOT EDIT header). Three full-CRUD resources fold into the existing client.fabric container (the spec declares x-sdk-namespace.attr: fabric), siblings of the read-only client.fabric.addresses: client.fabric.sip_addresses -> /api/fabric/sip_addresses client.fabric.phone_number_addresses -> /api/fabric/phone_number_addresses client.fabric.alias_addresses -> /api/fabric/alias_addresses Each has list/get/delete (from CrudResource) + closed-typed create/update (PATCH), bound to the spec's typed request/response schemas. Generated: - fabric_addresses_resources_generated.py — SipAddresses / PhoneNumberAddresses / AliasAddresses typed CRUD subclasses. - fabric_addresses_types_generated.py — 47 TypedDicts (bodies, lists, 422s, shared status-code schemas). - _client_tree_generated.py — the three new accessors wired under FabricNamespace. - tests/unit/rest/fabric_generated_test.py — the generator's wire-test suite, now covering the three new resources (CRUD success + a 500 error path each). Hand-written (over the shared mock, no requests mock.patch): - tests/unit/rest/test_fabric_addresses_mock.py — 21 tests: every CRUD op asserts (method, path, matched_route) on the wire, plus a structured 401 Unauthorized and 404 Not Found error path per resource. Requires the coordinated porting-sdk feat/fabric-addresses PR (the spec + SPEC_NAMES + regenerated oracle). The 9-port fan-out is DEFERRED to a later owner-gated phase (cross-port red-until-implemented by design). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NqhUoqrbptHNS3cypq9s6t
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.
Phase 1 (python-first): generated fabric address-management resources
Generated resources + client wiring + tests for the three fabric address-management resources. Depends on the coordinated porting-sdk PR signalwire/porting-sdk#115 (the reshaped spec +
SPEC_NAMES+ regenerated oracle) — the mock only serves/api/fabric/{sip,phone_number,alias}_addressesonce that lands.All generated files were produced by porting-sdk's
generate_python_rest_types.py— NOT hand-written (they carryAUTO-GENERATED ... DO NOT EDIT).What landed
Three full-CRUD resources fold into the existing
client.fabriccontainer (the spec declaresx-sdk-namespace.attr: fabric), siblings of the read-onlyclient.fabric.addresses:client.fabric.sip_addresses/api/fabric/sip_addressesclient.fabric.phone_number_addresses/api/fabric/phone_number_addressesclient.fabric.alias_addresses/api/fabric/alias_addressesfabric_addresses_resources_generated.py—SipAddresses/PhoneNumberAddresses/AliasAddressestyped CRUD subclasses (closed-typed create/update + extras door).fabric_addresses_types_generated.py— 47 TypedDicts (bodies, lists, 422 shapes, shared status-code schemas)._client_tree_generated.py— the three accessors wired underFabricNamespace.tests/unit/rest/fabric_generated_test.py— the generator's wire-test suite, now covering the three new resources (CRUD success + a 500 error path each).Hand-written tests (over the shared mock, no
requestsmock.patch)tests/unit/rest/test_fabric_addresses_mock.py— 21 tests: every CRUD op asserts(method, path, matched_route)on the wire, plus a structured 401 Unauthorized and 404 Not Found error path per resource (surfacing asSignalWireRestErrorwith the rightstatus_code).Verification
client.fabric.{sip_addresses,phone_number_addresses,alias_addresses}resolve to the 3 new resource classes;client.fabric.addresses(read-only) unchanged. No new top-level accessor.MOCK_SIGNALWIRE_PORTpointed at a mock built from porting-sdk#115).audit_no_cheat_tests.pyontests/unit/rest: clean.--check(exit 0).Deferred
The 9-port fan-out is DEFERRED to a later owner-gated phase. Cross-port will be red-until-implemented by design.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NqhUoqrbptHNS3cypq9s6t