зеркало из https://github.com/Azure/autorest.git
Feature: Modelerfour pass externalDocs through (#4558)
This commit is contained in:
Родитель
622e7af7ee
Коммит
2519d915b0
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"changes": [
|
||||
{
|
||||
"packageName": "@autorest/modelerfour",
|
||||
"comment": "Added: Include `externalDocs` information in codemodel",
|
||||
"type": "minor"
|
||||
}
|
||||
],
|
||||
"packageName": "@autorest/modelerfour"
|
||||
}
|
|
@ -16,6 +16,7 @@ import {
|
|||
ParameterLocation,
|
||||
includeXDashKeys,
|
||||
includeXDashProperties,
|
||||
omitXDashProperties,
|
||||
} from "@azure-tools/openapi";
|
||||
import { keyBy } from "lodash";
|
||||
export interface XMSEnum {
|
||||
|
@ -243,8 +244,13 @@ export class Interpretations {
|
|||
}
|
||||
return undefined;
|
||||
}
|
||||
getExternalDocs(schema: OpenAPI.Schema): ExternalDocumentation | undefined {
|
||||
return undefined;
|
||||
|
||||
getExternalDocs(item: { externalDocs?: OpenAPI.ExternalDocumentation }): ExternalDocumentation | undefined {
|
||||
return item.externalDocs
|
||||
? new ExternalDocumentation(item.externalDocs.url, {
|
||||
description: item.externalDocs.description,
|
||||
})
|
||||
: undefined;
|
||||
}
|
||||
getExample(schema: OpenAPI.Schema): any {
|
||||
return undefined;
|
||||
|
|
|
@ -1654,6 +1654,7 @@ export class ModelerFour {
|
|||
extensions: this.interpret.getExtensionProperties(httpOperation),
|
||||
apiVersions: this.interpret.getApiVersions(pathItem),
|
||||
deprecated: this.interpret.getDeprecation(httpOperation),
|
||||
externalDocs: this.interpret.getExternalDocs(httpOperation),
|
||||
language: {
|
||||
default: {
|
||||
summary: httpOperation.summary,
|
||||
|
|
Загрузка…
Ссылка в новой задаче