From f01225e0122af4040f62d9c43544720efd2fec4f Mon Sep 17 00:00:00 2001 From: jld3103 Date: Wed, 11 Jan 2023 10:30:06 +0100 Subject: [PATCH] dynamite: Support OAS 3.0.3 --- packages/dynamite/lib/src/openapi_builder.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/dynamite/lib/src/openapi_builder.dart b/packages/dynamite/lib/src/openapi_builder.dart index 223a3924..dac09eaf 100644 --- a/packages/dynamite/lib/src/openapi_builder.dart +++ b/packages/dynamite/lib/src/openapi_builder.dart @@ -23,8 +23,9 @@ class OpenAPIBuilder implements Builder { ) as Map, ); final prefix = _toDartName(spec.info.title, uppercaseFirstCharacter: true); - if (spec.version != '3.1.0') { - throw Exception('Only OpenAPI 3.1.0 is supported'); + final supportedVersions = ['3.0.3', '3.1.0']; + if (!supportedVersions.contains(spec.version)) { + throw Exception('Only OpenAPI ${supportedVersions.join(', ')} are supported'); } final tags = [