From a58ffb88e82e0436149897273df8407b14423b2e Mon Sep 17 00:00:00 2001 From: jld3103 Date: Sun, 27 Nov 2022 23:08:29 +0100 Subject: [PATCH] dynamite: Validate spec version --- packages/dynamite/lib/src/openapi_builder.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/dynamite/lib/src/openapi_builder.dart b/packages/dynamite/lib/src/openapi_builder.dart index e4b348ac..4594a45d 100644 --- a/packages/dynamite/lib/src/openapi_builder.dart +++ b/packages/dynamite/lib/src/openapi_builder.dart @@ -22,6 +22,10 @@ class OpenAPIBuilder implements Builder { await buildStep.readAsString(inputId), ) as Map, ); + if (spec.version != '3.1.0') { + throw Exception('Only OpenAPI 3.1.0 is supported'); + } + final tags = [ null, if (spec.tags != null) ...[