Skip to content

Commit a23b6bc

Browse files
committed
Stop reading description and urls from rest-api-spec
1 parent d3cdec5 commit a23b6bc

File tree

3 files changed

+6
-66
lines changed

3 files changed

+6
-66
lines changed

compiler/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import { argv } from 'zx'
2323
import Compiler from './compiler'
2424
import validateRestSpec from './steps/validate-rest-spec'
2525
import addInfo from './steps/add-info'
26-
import addDescription from './steps/add-description'
2726
import validateModel from './steps/validate-model'
2827
import readDefinitionValidation from './steps/read-definition-validation'
2928
import addDeprecation from './steps/add-deprecation'
@@ -74,7 +73,6 @@ compiler
7473
.step(addDeprecation)
7574
.step(readDefinitionValidation)
7675
.step(validateRestSpec)
77-
.step(addDescription)
7876
.step(validateModel)
7977
.step(addExamples)
8078
.write()

compiler/src/model/build-model.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,12 @@ export function compileEndpoints (jsonSpec: Map<string, JsonSpec>): Record<strin
6464
for (const [api, spec] of jsonSpec.entries()) {
6565
map[api] = {
6666
name: api,
67-
description: spec.documentation.description,
67+
description: null,
6868
docUrl: null,
6969
request: null,
7070
requestBodyRequired: false,
7171
response: null,
72-
urls: spec.url.paths.map(path => {
73-
return {
74-
path: path.path,
75-
methods: path.methods,
76-
...(path.deprecated != null && { deprecation: path.deprecated })
77-
}
78-
})
72+
urls: []
7973
}
8074
map[api].availability = {}
8175
}
@@ -197,6 +191,10 @@ function compileClassOrInterfaceDeclaration (declaration: ClassDeclaration | Int
197191
throw new Error(`Cannot find url template for ${namespace}, very likely the specification folder does not follow the rest-api-spec`)
198192
}
199193

194+
if (type.description) {
195+
mapping.description = type.description || ''
196+
}
197+
200198
let pathMember: Node | null = null
201199
let bodyProperties: model.Property[] = []
202200
let bodyValue: model.ValueOf | null = null

compiler/src/steps/add-description.ts

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)