Skip to content

Commit de65a4b

Browse files
authored
Add dangling types to validation-errors.json (#5106)
* Add dangling types to validation-errors.json * Generate validation-errors.json
1 parent 6e4a3c5 commit de65a4b

File tree

2 files changed

+105
-1
lines changed

2 files changed

+105
-1
lines changed

compiler/src/steps/validate-model.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ export default async function validateModel (apiModel: model.Model, restSpec: Ma
186186
apiModel.endpoints.filter(ep => readyForValidation(ep)).forEach(validateEndpoint)
187187
apiModel.endpoints.filter(ep => !readyForValidation(ep)).forEach(validateEndpoint)
188188

189+
// Check types are used
190+
for (const type of apiModel.types) {
191+
if (!typesSeen.has(fqn(type.name))) {
192+
errors.addGeneralError(`Dangling type '${fqn(type.name)}'`)
193+
}
194+
}
195+
189196
// Removes types that we've not seen
190197
apiModel.types = apiModel.types.filter(type => typesSeen.has(fqn(type.name)))
191198

output/schema/validation-errors.json

Lines changed: 98 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,101 @@
11
{
22
"endpointErrors": {},
3-
"generalErrors": []
3+
"generalErrors": [
4+
"Dangling type '_global.scripts_painless_execute:PainlessExecutionPosition'",
5+
"Dangling type '_global.scripts_painless_execute:PainlessScript'",
6+
"Dangling type '_global.search._types:HitMetadata'",
7+
"Dangling type '_global.search._types:SmoothingModel'",
8+
"Dangling type '_spec_utils:Setting'",
9+
"Dangling type '_types:ActionIds'",
10+
"Dangling type '_types:CustomResponseBuilderBase'",
11+
"Dangling type '_types:DistanceParsed'",
12+
"Dangling type '_types:DynamicResponseBase'",
13+
"Dangling type '_types:ElasticsearchResponseBase'",
14+
"Dangling type '_types:ElasticsearchUrlFormatter'",
15+
"Dangling type '_types:HttpMethod'",
16+
"Dangling type '_types:IndexMetrics'",
17+
"Dangling type '_types:LatLon'",
18+
"Dangling type '_types:LogLevel'",
19+
"Dangling type '_types:LongId'",
20+
"Dangling type '_types:Transform'",
21+
"Dangling type '_types:UnitFloatSeconds'",
22+
"Dangling type '_types:Uri'",
23+
"Dangling type '_types:UrlParameter'",
24+
"Dangling type '_types:VersionNumbers'",
25+
"Dangling type '_types:VersionStrings'",
26+
"Dangling type '_types.aggregations:AggregationVisitorScope'",
27+
"Dangling type '_types.mapping:GeoTree'",
28+
"Dangling type '_types.mapping:PropertyWithClrOrigin'",
29+
"Dangling type '_types.query_dsl:CharacterType'",
30+
"Dangling type '_types.query_dsl:FieldNameQuery'",
31+
"Dangling type '_types.query_dsl:GeoFormat'",
32+
"Dangling type '_types.query_dsl:Intervals'",
33+
"Dangling type '_types.query_dsl:RewriteMultiTerm'",
34+
"Dangling type '_types.query_dsl:SpanSubQuery'",
35+
"Dangling type '_types.query_dsl:TokenType'",
36+
"Dangling type '_types.query_dsl:VisitorScope'",
37+
"Dangling type 'cat.transforms:TransformState'",
38+
"Dangling type 'cat.transforms:TransformType'",
39+
"Dangling type 'cluster.allocation_explain:StoreCopy'",
40+
"Dangling type 'cluster.reroute:CommandAction'",
41+
"Dangling type 'esql._types:DataPartitioning'",
42+
"Dangling type 'ilm._types:Configurations'",
43+
"Dangling type 'ilm._types:ForceMergeConfiguration'",
44+
"Dangling type 'ilm._types:ShrinkConfiguration'",
45+
"Dangling type 'indices._types:Fielddata'",
46+
"Dangling type 'indices._types:FielddataFilter'",
47+
"Dangling type 'indices._types:FielddataLoading'",
48+
"Dangling type 'indices._types:FielddataRegexFilter'",
49+
"Dangling type 'indices._types:FielddataSettings'",
50+
"Dangling type 'indices._types:GeoPointFielddataFormat'",
51+
"Dangling type 'indices._types:IndicesCircuitBreakerSettings'",
52+
"Dangling type 'indices._types:IndicesModuleSettings'",
53+
"Dangling type 'indices._types:IndicesRecoverySettings'",
54+
"Dangling type 'indices._types:OverlappingIndexTemplate'",
55+
"Dangling type 'indices._types:StringFielddata'",
56+
"Dangling type 'indices._types:StringFielddataFormat'",
57+
"Dangling type 'indices.stats:ShardFielddata'",
58+
"Dangling type 'inference._types:AmazonSageMakerElasticServiceSettings'",
59+
"Dangling type 'inference._types:AmazonSageMakerElasticTaskSettings'",
60+
"Dangling type 'inference._types:AmazonSageMakerElementType'",
61+
"Dangling type 'inference._types:AmazonSageMakerOpenAiTaskSettings'",
62+
"Dangling type 'inference._types:AmazonSageMakerSimilarity'",
63+
"Dangling type 'inference._types:EisServiceSettings'",
64+
"Dangling type 'inference._types:EisServiceType'",
65+
"Dangling type 'inference._types:EisTaskSettings'",
66+
"Dangling type 'inference._types:EisTaskType'",
67+
"Dangling type 'ingest._types:PipelineFailure'",
68+
"Dangling type 'ml._types:CountFunction'",
69+
"Dangling type 'ml._types:DistinctCountFunction'",
70+
"Dangling type 'ml._types:GeographicFunction'",
71+
"Dangling type 'ml._types:InfoContentFunction'",
72+
"Dangling type 'ml._types:MetricFunction'",
73+
"Dangling type 'ml._types:ModelPlotConfigEnabled'",
74+
"Dangling type 'ml._types:NlpInferenceConfigUpdateContainer'",
75+
"Dangling type 'ml._types:NlpTokenizationUpdateContainer'",
76+
"Dangling type 'ml._types:NonNullSumFunction'",
77+
"Dangling type 'ml._types:NonZeroCountFunction'",
78+
"Dangling type 'ml._types:RareFunction'",
79+
"Dangling type 'ml._types:SumFunction'",
80+
"Dangling type 'search_application._types:AnalyticsEvent'",
81+
"Dangling type 'transform._types:Sync'",
82+
"Dangling type 'watcher._types:Interval'",
83+
"Dangling type 'watcher._types:IntervalUnit'",
84+
"Dangling type 'watcher._types:JiraAction'",
85+
"Dangling type 'watcher._types:JiraIssueAssignee'",
86+
"Dangling type 'watcher._types:JiraIssueFields'",
87+
"Dangling type 'watcher._types:JiraIssuePriority'",
88+
"Dangling type 'watcher._types:JiraIssueProject'",
89+
"Dangling type 'watcher._types:JiraIssueReporter'",
90+
"Dangling type 'watcher._types:JiraIssueType'",
91+
"Dangling type 'watcher._types:PagerDutySentEvent'",
92+
"Dangling type 'watcher._types:SimpleInput'",
93+
"Dangling type 'watcher._types:SlackActionMessageResult'",
94+
"Dangling type 'watcher._types:TriggerEvent'",
95+
"Dangling type 'xpack.usage:Alerting'",
96+
"Dangling type 'xpack.usage:AlertingExecution'",
97+
"Dangling type 'xpack.usage:AlertingInput'",
98+
"Dangling type 'xpack.usage:ExecutionAction'",
99+
"Dangling type 'xpack.usage:ForecastStatistics'"
100+
]
4101
}

0 commit comments

Comments
 (0)