Last active
November 29, 2023 04:23
-
-
Save adamaltman/338161349d47e4e95b6fa7ce5ae98481 to your computer and use it in GitHub Desktop.
Adds x-openai-isConsequential to GET operations of OpenAPI files. To use, register the decorator in a plugin.
This file contains 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
module.exports = OpenAIConsequential; | |
/** @type {import('@redocly/cli').OasDecorator} */ | |
function OpenAIConsequential() { | |
return { | |
PathItem(PathItem) { | |
if (PathItem['get']) { | |
PathItem['get']['x-openai-isConsequential'] = true; | |
} | |
} | |
} | |
}; |
One file:
module.exports = {
id: "openai-plugin",
decorators: {
oas3: {
"is-consequential": OpenAIConsequential,
},
},
};
/** @type {import('@redocly/cli').OasDecorator} */
function OpenAIConsequential({title}) {
return {
PathItem(PathItem) {
if (PathItem['get']) {
PathItem['get']['x-openai-isConsequential'] = true;
}
}
}
};
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixed in revision 3. 👍