Skip to content

Commit 4afa7b4

Browse files
authored
Merge branch 'main' into endpoints-not-models
2 parents b5189cc + 7d38f5f commit 4afa7b4

File tree

8 files changed

+284
-27
lines changed

8 files changed

+284
-27
lines changed

compiler/src/steps/validate-model.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import * as model from '../model/metamodel'
2121
import { ValidationErrors } from '../validation-errors'
2222
import { JsonSpec } from '../model/json-spec'
2323
import assert from 'assert'
24+
import { TypeName } from '../model/metamodel'
2425

2526
// Superclasses (i.e. non-leaf types, who are inherited or implemented) that are ok to be used as field types because
2627
// they're used as definition reuse and not as polymorphic types.
@@ -170,8 +171,14 @@ export default async function validateModel (apiModel: model.Model, restSpec: Ma
170171
})
171172
}
172173

173-
// ErrorResponse is not referenced anywhere, but any API could return it if an error happens.
174-
validateTypeRef({ namespace: '_types', name: 'ErrorResponseBase' }, undefined, new Set())
174+
const additionalRoots: TypeName[] = [
175+
// ErrorResponse is not referenced anywhere, but any API could return it if an error happens.
176+
{ namespace: '_types', name: 'ErrorResponseBase' },
177+
// ESQL base versions are pseudo-constants
178+
{ namespace: 'esql._types', name: 'BaseStatefulEsqlVersion' },
179+
{ namespace: 'esql._types', name: 'BaseServerlessEsqlVersion' }
180+
]
181+
additionalRoots.forEach(t => validateTypeRef(t, undefined, new Set()))
175182

176183
// ----- Alright, let's go!
177184

output/openapi/elasticsearch-serverless-openapi.json

Lines changed: 54 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema.json

Lines changed: 159 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)