← Inside orch contents

Chapter 7 - Worked Answers

1. Read outer wrappers first

requestIDMiddleware and apiVersionMiddleware wrap the authentication middleware. They set response metadata before the user-auth check returns a rejection, so configured JWT failures can still be correlated and versioned. The header does not prove authentication succeeded or that a domain mutation occurred. Namespace validation also precedes role checks within user-auth middleware.

2. Handle a malformed identifier

Branch on status400 and code invalid_argument, as verified by the public-client smoke test. Display or retain the message as human guidance, and retain RequestID for log correlation. Do not match the complete message text or interpret RequestID as a commit record. A404 would describe another condition, while a transport failure may not contain any API envelope. The client preserves status even when an intermediary returns an unexpected error body.

3. Distinguish addition from rename

The fixture adds future_hint while retaining service.spec.name, so the ordinary JSON decoder ignores the unfamiliar field and preserves the known name. Renaming name to service_name removes the field the old client knows. Its decoder ignores the new field and leaves Name empty, even though syntax decoding succeeds. This is a semantic compatibility failure demonstrated by a controlled fixture, not a change to the real API. Both fixtures were executed in the recorded smoke test.

4. Respect the intended audience

The upstream test explicitly forbids /v1/agent/ paths in the public schema. Those use node-registration and agent-report contracts and should not be counted as public omissions. The genuine compared omissions are GET /v1/discovery/services, GET /v1/discovery/services/{name}, and GET /v1/integrations/traefik/config. DOC015 preserves their exact router anchors. Static method coverage does not establish correctness of all schemas or configured authentication; those remain additional checks.

Return to Chapter 7.