Browse Source

fix(dynamite): supported file extensions

Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
pull/772/head
Nikolas Rimikis 1 year ago
parent
commit
5b88e58687
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 4
      packages/dynamite/dynamite/lib/src/openapi_builder.dart

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

@ -34,11 +34,11 @@ class OpenAPIBuilder implements Builder {
); );
final spec = switch (inputId.extension) { final spec = switch (inputId.extension) {
'json' => serializers.deserializeWith( '.json' => serializers.deserializeWith(
OpenAPI.serializer, OpenAPI.serializer,
json.decode(await buildStep.readAsString(inputId)), json.decode(await buildStep.readAsString(inputId)),
)!, )!,
'yaml' => checkedYamlDecode( '.yaml' => checkedYamlDecode(
await buildStep.readAsString(inputId), await buildStep.readAsString(inputId),
(final m) => serializers.deserializeWith(OpenAPI.serializer, m)!, (final m) => serializers.deserializeWith(OpenAPI.serializer, m)!,
), ),

Loading…
Cancel
Save