Documentation
¶
Overview ¶
Package protocolgen generates the Go types for the codex app-server v2 protocol from the vendored JSON Schema snapshot under schema/.
The snapshot is produced by the pinned codex CLI (`codex app-server generate-json-schema --experimental`). Generic JSON-Schema code generators cannot represent the serde union encodings this protocol uses, so this package implements a small purpose-built generator that handles exactly the schema shapes present in the snapshot and fails loudly on anything else.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Schema ¶
type Schema struct {
// Any marks the boolean schema `true`, which accepts any value.
Any bool `json:"-"`
Ref string `json:"$ref"`
SchemaTag string `json:"$schema"`
Type typeList `json:"type"`
Properties map[string]*Schema `json:"properties"`
Required []string `json:"required"`
Items *Schema `json:"items"`
AddlProps *addlProps `json:"additionalProperties"`
Enum []json.RawMessage `json:"enum"`
OneOf []*Schema `json:"oneOf"`
AnyOf []*Schema `json:"anyOf"`
AllOf []*Schema `json:"allOf"`
Format string `json:"format"`
Title string `json:"title"`
Description string `json:"description"`
Definitions map[string]*Schema `json:"definitions"`
Default json.RawMessage `json:"default"`
Minimum json.RawMessage `json:"minimum"`
MinLength json.RawMessage `json:"minLength"`
}
Schema models the subset of JSON Schema draft-07 that the codex snapshot actually uses. Loading fails if a document contains anything outside it. The boolean schema form (`true` = anything) is represented by Any.