Skip to content

Conversation

@jorre127
Copy link
Contributor

closes #124

Copy link
Contributor

@vanlooverenkoen vanlooverenkoen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Write tests to check that the old implementation is not possible anymore.

CHANGELOG.md Outdated
@@ -1,7 +1,10 @@
# Changelog
## [6.4.0] - 2023-08-14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaking change should be 7.0.0

README.md Outdated
roles: List<string>
customProperties: Map<String, Property>?
```
since 6.4.0 inline types are supported now even when adding extra configuration:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update version & the rest of this readme as well. So the readme matches the latest version

non_final: true
dateChange:
type: datetime
type: datetime?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better to already switch everything to String & DateTime instead of lowercase?

expect(simpleDateTime.isRequired, false);
});

test('Test required not definable anymore', () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add tests for list & map with the correct config.

And also add test for the old config. -> that should expect an exception

@vanlooverenkoen
Copy link
Contributor

Fix readme

Field getField(String name, YamlMap property,
{required bool disallowNullForDefaults}) {
try {
final required =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe for this release do it llike this.

if( property.containsKey('required')){
 throw ArgumentError('required is removed, follow the migration to version 7.0.0);
}

expect(requiredString1.type, isA<StringType>());
expect(requiredString1.isRequired, true);

expect(optionalString2.type, isA<StringType>());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use same formatting as your TestModel

error = e;
}

expect(error, isNotNull);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check if the error is in fact related to the required:true so check the actual error not just isNotNull

} catch (e) {
error = e;
}
expect(error, isNotNull);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the actual error

} catch (e) {
error = e;
}
expect(error, isNotNull);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the actual error

@vanlooverenkoen vanlooverenkoen merged commit 8feb918 into master Aug 30, 2023
@vanlooverenkoen vanlooverenkoen deleted the #124-make-type-detector-smarter branch August 30, 2023 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the type detector even smarter

2 participants