Browse Source

dynamite: Validate spec version

pull/137/head
jld3103 2 years ago
parent
commit
a58ffb88e8
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 4
      packages/dynamite/lib/src/openapi_builder.dart

4
packages/dynamite/lib/src/openapi_builder.dart

@ -22,6 +22,10 @@ class OpenAPIBuilder implements Builder {
await buildStep.readAsString(inputId), await buildStep.readAsString(inputId),
) as Map<String, dynamic>, ) as Map<String, dynamic>,
); );
if (spec.version != '3.1.0') {
throw Exception('Only OpenAPI 3.1.0 is supported');
}
final tags = <Tag?>[ final tags = <Tag?>[
null, null,
if (spec.tags != null) ...[ if (spec.tags != null) ...[

Loading…
Cancel
Save