Skip to content

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

Open
omnifaced wants to merge 1 commit into
argon-chat:masterfrom
omnifaced:feat/bot-api-machine-readable-enums
Open

omnifaced wants to merge 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

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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BjYorEWFhiaFKUgjL5wg6m
@github-actions

Copy link
Copy Markdown
Contributor

Contributor License Agreement — signed.

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

Warning

These commit author addresses are not linked to any GitHub account, so we cannot tell whose
contribution they are:

  • noreply@anthropic.com

Either add the address at https://github.com/settings/emails, or rewrite the commits with
an address that is already on your account:

git rebase -i --exec "git commit --amend --no-edit --reset-author" origin/master
git push --force-with-lease

@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!

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.

1 participant