Browse Source

Merge pull request #180 from provokateurin/feature/support-oas-3.0.3

dynamite: Support OAS 3.0.3
pull/181/head
Kate 2 years ago committed by GitHub
parent
commit
933d9cfd87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      packages/dynamite/lib/src/openapi_builder.dart

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

@ -23,8 +23,9 @@ class OpenAPIBuilder implements Builder {
) as Map<String, dynamic>,
);
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 = <Tag?>[

Loading…
Cancel
Save