Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions compiler/src/steps/validate-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,13 @@ export default async function validateModel (apiModel: model.Model, restSpec: Ma
apiModel.endpoints.filter(ep => readyForValidation(ep)).forEach(validateEndpoint)
apiModel.endpoints.filter(ep => !readyForValidation(ep)).forEach(validateEndpoint)

// Check types are used
for (const type of apiModel.types) {
if (!typesSeen.has(fqn(type.name))) {
errors.addGeneralError(`Dangling type '${fqn(type.name)}'`)
}
}

// Removes types that we've not seen
apiModel.types = apiModel.types.filter(type => typesSeen.has(fqn(type.name)))

Expand Down
99 changes: 98 additions & 1 deletion output/schema/validation-errors.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,101 @@
{
"endpointErrors": {},
"generalErrors": []
"generalErrors": [
"Dangling type '_global.scripts_painless_execute:PainlessExecutionPosition'",
"Dangling type '_global.scripts_painless_execute:PainlessScript'",
"Dangling type '_global.search._types:HitMetadata'",
"Dangling type '_global.search._types:SmoothingModel'",
"Dangling type '_spec_utils:Setting'",
"Dangling type '_types:ActionIds'",
"Dangling type '_types:CustomResponseBuilderBase'",
"Dangling type '_types:DistanceParsed'",
"Dangling type '_types:DynamicResponseBase'",
"Dangling type '_types:ElasticsearchResponseBase'",
"Dangling type '_types:ElasticsearchUrlFormatter'",
"Dangling type '_types:HttpMethod'",
"Dangling type '_types:IndexMetrics'",
"Dangling type '_types:LatLon'",
"Dangling type '_types:LogLevel'",
"Dangling type '_types:LongId'",
"Dangling type '_types:Transform'",
"Dangling type '_types:UnitFloatSeconds'",
"Dangling type '_types:Uri'",
"Dangling type '_types:UrlParameter'",
"Dangling type '_types:VersionNumbers'",
"Dangling type '_types:VersionStrings'",
"Dangling type '_types.aggregations:AggregationVisitorScope'",
"Dangling type '_types.mapping:GeoTree'",
"Dangling type '_types.mapping:PropertyWithClrOrigin'",
"Dangling type '_types.query_dsl:CharacterType'",
"Dangling type '_types.query_dsl:FieldNameQuery'",
"Dangling type '_types.query_dsl:GeoFormat'",
"Dangling type '_types.query_dsl:Intervals'",
"Dangling type '_types.query_dsl:RewriteMultiTerm'",
"Dangling type '_types.query_dsl:SpanSubQuery'",
"Dangling type '_types.query_dsl:TokenType'",
"Dangling type '_types.query_dsl:VisitorScope'",
"Dangling type 'cat.transforms:TransformState'",
"Dangling type 'cat.transforms:TransformType'",
"Dangling type 'cluster.allocation_explain:StoreCopy'",
"Dangling type 'cluster.reroute:CommandAction'",
"Dangling type 'esql._types:DataPartitioning'",
"Dangling type 'ilm._types:Configurations'",
"Dangling type 'ilm._types:ForceMergeConfiguration'",
"Dangling type 'ilm._types:ShrinkConfiguration'",
"Dangling type 'indices._types:Fielddata'",
"Dangling type 'indices._types:FielddataFilter'",
"Dangling type 'indices._types:FielddataLoading'",
"Dangling type 'indices._types:FielddataRegexFilter'",
"Dangling type 'indices._types:FielddataSettings'",
"Dangling type 'indices._types:GeoPointFielddataFormat'",
"Dangling type 'indices._types:IndicesCircuitBreakerSettings'",
"Dangling type 'indices._types:IndicesModuleSettings'",
"Dangling type 'indices._types:IndicesRecoverySettings'",
"Dangling type 'indices._types:OverlappingIndexTemplate'",
"Dangling type 'indices._types:StringFielddata'",
"Dangling type 'indices._types:StringFielddataFormat'",
"Dangling type 'indices.stats:ShardFielddata'",
"Dangling type 'inference._types:AmazonSageMakerElasticServiceSettings'",
"Dangling type 'inference._types:AmazonSageMakerElasticTaskSettings'",
"Dangling type 'inference._types:AmazonSageMakerElementType'",
"Dangling type 'inference._types:AmazonSageMakerOpenAiTaskSettings'",
"Dangling type 'inference._types:AmazonSageMakerSimilarity'",
"Dangling type 'inference._types:EisServiceSettings'",
"Dangling type 'inference._types:EisServiceType'",
"Dangling type 'inference._types:EisTaskSettings'",
"Dangling type 'inference._types:EisTaskType'",
"Dangling type 'ingest._types:PipelineFailure'",
"Dangling type 'ml._types:CountFunction'",
"Dangling type 'ml._types:DistinctCountFunction'",
"Dangling type 'ml._types:GeographicFunction'",
"Dangling type 'ml._types:InfoContentFunction'",
"Dangling type 'ml._types:MetricFunction'",
"Dangling type 'ml._types:ModelPlotConfigEnabled'",
"Dangling type 'ml._types:NlpInferenceConfigUpdateContainer'",
"Dangling type 'ml._types:NlpTokenizationUpdateContainer'",
"Dangling type 'ml._types:NonNullSumFunction'",
"Dangling type 'ml._types:NonZeroCountFunction'",
"Dangling type 'ml._types:RareFunction'",
"Dangling type 'ml._types:SumFunction'",
"Dangling type 'search_application._types:AnalyticsEvent'",
"Dangling type 'transform._types:Sync'",
"Dangling type 'watcher._types:Interval'",
"Dangling type 'watcher._types:IntervalUnit'",
"Dangling type 'watcher._types:JiraAction'",
"Dangling type 'watcher._types:JiraIssueAssignee'",
"Dangling type 'watcher._types:JiraIssueFields'",
"Dangling type 'watcher._types:JiraIssuePriority'",
"Dangling type 'watcher._types:JiraIssueProject'",
"Dangling type 'watcher._types:JiraIssueReporter'",
"Dangling type 'watcher._types:JiraIssueType'",
"Dangling type 'watcher._types:PagerDutySentEvent'",
"Dangling type 'watcher._types:SimpleInput'",
"Dangling type 'watcher._types:SlackActionMessageResult'",
"Dangling type 'watcher._types:TriggerEvent'",
"Dangling type 'xpack.usage:Alerting'",
"Dangling type 'xpack.usage:AlertingExecution'",
"Dangling type 'xpack.usage:AlertingInput'",
"Dangling type 'xpack.usage:ExecutionAction'",
"Dangling type 'xpack.usage:ForecastStatistics'"
]
}