Skip to content

feat: describe bot API enums with their wire values - #257

Merged
0xF6 merged 1 commit into
argon-chat:masterfrom
omnifaced:feat/bot-api-machine-readable-enums
Oct 28, 2026
Merged

0xF6 merged 1 commit into
argon-chat:masterfrom
omnifaced:feat/bot-api-machine-readable-enums

Conversation

@omnifaced

Copy link
Copy Markdown
Contributor

The docs manifest gave enums as bare names under type: string, and the OpenAPI document gave number enums as a plain integer. Both serializers write those enums as numbers, so a client built from either description sent "bold" where the server reads 10, and read user flags and entitlements as names where bitmasks arrive.

  • The manifest has a top-level enums list: wire format (number or string), underlying type, whether it is a flags enum, and each member's number. Enum fields reference it through enumType, and their type is the JSON type that travels. enumValues keeps its camelCase names, so the docs site reads it as before. Union variants also carry their discriminator's number.
  • OpenAPI lists number enum values in enum with x-enum-varnames, and flags enums map names to bits in x-argon-flags. Ion enums are unsigned, and the writer silently drops ulong nodes, so values are written as long.
  • The IEvents/v1/Stream body is a server-sent event stream whose data: is the bare payload, not the BotSseEvent envelope the route declares.

Bumps docs/bot-api-docs to the regenerated description.

Claude-Session: https://claude.ai/code/session_01BjYorEWFhiaFKUgjL5wg6m

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Contributor License Agreement — signed.

All contributors to this pull request have signed the CLA: @omnifaced.

@codecov

codecov Bot commented Oct 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.36937% with 34 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../Argon.Core/Features/BotApi/BotContractVerifier.cs 68.11% 17 Missing and 5 partials ⚠️
src/Argon.Core/Features/BotApi/BotOpenApi.cs 71.42% 7 Missing and 5 partials ⚠️

📢 Thoughts on this report? Let us know!

@omnifaced
omnifaced force-pushed the feat/bot-api-machine-readable-enums branch 2 times, most recently from 2839154 to 20b74e8 Compare October 28, 2026 00:35
The docs manifest gave enums as bare names under `type: string`, and the
OpenAPI document gave number enums as a plain `integer`. Both serializers
write those enums as numbers, so a client built from either description
sent `"bold"` where the server reads 10, and read user flags and
entitlements as names where bitmasks arrive.

- The manifest has a top-level `enums` list: wire format (`number` or
  `string`), underlying type, whether it is a flags enum, and each member's
  number. Enum fields reference it through `enumType`, and their `type` is
  the JSON type that travels. `enumValues` keeps its camelCase names, so
  the docs site reads it as before. Union variants also carry their
  discriminator's number.
- OpenAPI lists number enum values in `enum` with `x-enum-varnames`, and
  flags enums map names to bits in `x-argon-flags`. Ion enums are unsigned,
  and the writer silently drops ulong nodes, so values are written as long.
- The IEvents/v1/Stream body is a server-sent event stream whose `data:` is
  the bare payload, not the BotSseEvent envelope the route declares.

Bumps docs/bot-api-docs to the regenerated description.
@omnifaced
omnifaced force-pushed the feat/bot-api-machine-readable-enums branch from 20b74e8 to 32889cb Compare October 28, 2026 07:43
@0xF6
0xF6 merged commit 76bc964 into argon-chat:master Oct 28, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants