feat: Add x-codemode extension for OpenAPI spec - #38
Draft
thomaswinkler wants to merge 2 commits into
Draft
Conversation
schplitt
marked this pull request as draft
June 15, 2026 06:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-codemodeitem on an operation carries aninstructionfor the LLM and an optional path reference (includeorquery) that controls how much context is pre-loaded:instructionincludequerycall.queryqueryPath) 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.