Browse Source

dynamite: Fix mappings with $ref name

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

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

@ -1379,7 +1379,7 @@ TypeResult resolveType(
], ],
for (final result in results) ...[ for (final result in results) ...[
if (schema.discriminator != null) ...[ if (schema.discriminator != null) ...[
"if (data['${schema.discriminator!.propertyName}'] == '${result.name}'", "if (data['${schema.discriminator!.propertyName}'] == '${result.name.replaceFirst(state.prefix, '')}'",
if (schema.discriminator!.mapping != null && if (schema.discriminator!.mapping != null &&
schema.discriminator!.mapping!.isNotEmpty) ...[ schema.discriminator!.mapping!.isNotEmpty) ...[
for (final key in schema.discriminator!.mapping!.entries for (final key in schema.discriminator!.mapping!.entries

Loading…
Cancel
Save