Skip to content

schemas: remove unnecessary ml-kem oneOf indirection#233

Open
cpu wants to merge 1 commit intoC2SP:mainfrom
cpu:cpu-mlkem-schema-tweaks
Open

schemas: remove unnecessary ml-kem oneOf indirection#233
cpu wants to merge 1 commit intoC2SP:mainfrom
cpu:cpu-mlkem-schema-tweaks

Conversation

@cpu
Copy link
Copy Markdown
Member

@cpu cpu commented Apr 13, 2026

oneOf with a single option doesn't offer us much, and comes at the cost of ugly code generation (e.g. interface{} types in generated Go code). Instead, just use a direct $ref of the one group definition in use.

Using go-jsonschema's output as an example:

Before:

  type MlkemTestSchemaJson struct {
  	// ...
  	TestGroups []interface{} `json:"testGroups"`
  }

After:

  type MlkemTestSchemaJson struct {
  	// ...
  	TestGroups []MLKEMTestGroup `json:"testGroups"`
  }

`oneOf` with a single option doesn't offer us much, and comes at the
cost of ugly code generation (e.g. `interface{}` types in generated Go
code). Instead, just use a direct `$ref` of the one group definition in
use.
@cpu cpu self-assigned this Apr 13, 2026
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