The protocol is bidirectional, i.e. AutoRest may call the API of the extension and vice versa.
- TypeScript: autorest-extension-base (example extension: autorest-extension-helloworld)
- C#: see azure-openapi-validator
GetPluginNames(): string[]
Process(pluginName: string, sessionId: string): boolean
ListInputs(sessionId: string): string[]
ReadFile(sessionId: string, filename: string): string
GetValue(sessionId: string, key: string): any
WriteFile(sessionId: string, filename: string, content: string, sourceMap?: Mapping[] | RawSourceMap): void
Message(sessionId: string, message: Message): void
{
Channel: "information" | "warning" | "error" | "debug" | "verbose"
Key?: string[]
Details?: any
Text: string
Source?: SourceLocation[]
}
{
document: string // the URI of the input document (as used for `ReadFile`)
Position: Position
}
{
line: number // 1-based
column: number // 0-based
} |
{
path: (string | number)[] // object path (e.g. `['b', 3, 'a']` for $.b[3].a)
}
{
generated: Position // position in generated document
original: Position // position in source document
source: string // the URI of the input document (as used for `ReadFile`)
name?: string
}
see An Introduction to Source Maps
{
file?: string
sourceRoot?: string
version: string
sources: string[]
names: string[]
sourcesContent?: string[]
mappings: string
}