Skip to content

feat: Add x-codemode extension for OpenAPI spec - #38

Draft
thomaswinkler wants to merge 2 commits into
schplitt:mainfrom
thomaswinkler:feat/x-codemode-openapi-extension
Draft

feat: Add x-codemode extension for OpenAPI spec#38
thomaswinkler wants to merge 2 commits into
schplitt:mainfrom
thomaswinkler:feat/x-codemode-openapi-extension

Conversation

@thomaswinkler

@thomaswinkler thomaswinkler commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Introduces x-codemode, an OpenAPI extension to allow providing additional instructions or include additional operations into a code mode response. The DTM spec includeas a simple example for testing (e.g. PropertyDefinitions as prerequisite for AssetDefinition).

Each x-codemode item on an operation carries an instruction for the LLM and an optional path reference (include or query) that controls how much context is pre-loaded:

Field Behavior
instruction Pure LLM-only context — idempotency hints, required headers, constraints not visible in standard tooling
include Mandatory prerequisite — the referenced path's full spec is embedded inline at build/discovery time. The LLM gets everything it needs without an extra query call.
query Advisory hint — only the service-prefixed path (queryPath) is computed. The LLM queries it if and only if the user's request actually requires the dependency.

Notes

This is meant as an extension to improve modelling of agent experience within the OpenAPI. It depends on the use case and spec itself of when to include information into the user doc or as a code-mode extension only for the agent. Needs some more thoughts and use case evaluation. Results have been much better with DTM example extension for creating Asset Definitions including Property Definitions.

@schplitt
schplitt marked this pull request as draft June 15, 2026 06:32
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