> ## Documentation Index
> Fetch the complete documentation index at: https://os.inttegro.dev/simile/llms.txt
> Use this file to discover all available pages before exploring further.

# HTTP contract surface

> See how routes, parameters, bodies, and protocol failures cross the HTTP boundary.

The HTTP adapter is intentionally thin. It translates wire input into the protocol-neutral service
supervisor and never reparses the source contract at request time.

```mermaid theme={null}
flowchart LR
  Wire[HTTP request] --> Route[Literal and template routing]
  Route --> Parameters[Path, query, header, cookie decoding]
  Parameters --> Schema[Compiled schema validation]
  Schema --> Runtime[Operation runtime]
  Runtime --> Supervisor[Effect and state supervisor]
  Supervisor --> WireResponse[HTTP response]
```

## Route and parameter ownership

Source-level parameter declarations are normalized during compilation. Where OpenAPI supplies both
path-item and operation parameters, the operation-level declaration overrides the same location
and name. Header names compare case-insensitively, and local references are resolved at compile
time.

Simile compiles parameter schemas into the same portable schema catalog used by request bodies.
The server validates required presence, scalar types, arrays, objects, patterns, bounds, and other
supported schema rules for:

* template path parameters;
* repeated and delimited query parameters;
* case-insensitive headers; and
* parsed cookie pairs.

Common compiled parameter styles are decoded without source parsing. For OpenAPI contracts, the
fidelity audit reports styles that are valid OpenAPI but not executable by the current adapter.

Request bodies support JSON and structured JSON media types, form URL encoding, multipart form
data, and text media types. See [Request encoding](https://os.inttegro.dev/simile/request-encoding.md) for the complete wire mapping.

Responses use the same compiled boundary. The adapter emits JSON, text, form URL-encoded,
multipart, and octet-stream bodies, plus declared response headers. A bodyless redirect can
therefore carry its schema-checked `Location` header directly from the compiled contract.

## Authentication boundary

Route matching resolves the operation before authentication runs. The adapter then evaluates the
operation's OpenAPI security alternatives against local HCL principal contracts and profiles. Accepted identities
continue to parameter and body validation; missing credentials return `401`, while known active
identities without required grants return `403`.

See [Authentication emulation](https://os.inttegro.dev/simile/authentication-emulation.md) for schemes, principals, grants, and
lifecycle states.

## Helpful failures

A parameter failure identifies the location, public parameter name, rule, and message. If the
provider maps the public `malformed_request` cause, Simile renders that provider error; otherwise it
returns a structured diagnostic envelope. Request-body failures follow the same provider-first
policy.

Literal routes win over templates. Unknown paths return `404`, a known path with the wrong method
returns `405`, and both are decided before operation execution. Bodies are limited to 8 MiB.

Mutual TLS remains an explicit adapter boundary because the listener has no verified client
certificate input. See [Capabilities and limits](https://os.inttegro.dev/simile/current-boundaries.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.