Browse Source

Merge pull request #249 from provokateurin/fix/dynamite-patterns

dynamite: Fix patterns
pull/240/head
Kate 2 years ago committed by GitHub
parent
commit
5dcd716114
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/dynamite/lib/src/openapi_builder.dart

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

@ -725,7 +725,7 @@ class OpenAPIBuilder implements Builder {
if (parameter.schema?.pattern != null) {
code.write('''
if (!RegExp(r'${parameter.schema!.pattern!}').hasMatch(${_toDartName(parameter.name)})) {
throw Exception('Invalid value "\$${_toDartName(parameter.name)}" for parameter "${_toDartName(parameter.name)}" with pattern "' r'${parameter.schema!.pattern!}"'); // coverage:ignore-line
throw Exception('Invalid value "\$${_toDartName(parameter.name)}" for parameter "${_toDartName(parameter.name)}" with pattern "\${r'${parameter.schema!.pattern!}'}"'); // coverage:ignore-line
}
''');
}

Loading…
Cancel
Save