Repository navigation
feat: Interface Model Support - #3248
Closed
BenAuerDev wants to merge 3 commits into
Closed
BenAuerDev wants to merge 3 commits into
BenAuerDev wants to merge 3 commits into
Conversation
keywords.dart - add `interfaceType => 'interface'` - add `isImplementing => 'implements' definitions.dart - add `isInterface` (bool) field - add `isImplementing` (List<InheritanceDefinition)` field - add `implementedInterfaces` getter - add `implementedFields` getter - add `fieldsIncludingImplemented` getter - update `inheritedFields` getter entity_dependency_resolver: - extract logic from `_resolveInheritance` into `_resolveExtends` - add private method `_resolveImplements` - add both `_resolveExtends` and `_resolveImplements` to be called in `_resolveInheritance` model_parser: - parse `isImplementing` and `isInterface` model_analyzer: - add `interfaceType` to analyzer restrictions.dart: - add restrictions for `interfaceType` `class_yaml_definition` and `exception_yaml_definition`: - add ValidateNode for `isImplementing` interface_yaml_definition.dart: - add `InterfaceYamlDefinition` for analyzer `extra_properties_test`, `inheritance_test` and `model_types_test`: - update tests returning a set of white listed node names as interface is now a white listed
model_library_generator: - update if statements to only generate what we need for an interface - add logic to handle implementing interfaces - update logic handling fields - add logic to add the `override` annotation to fields inherited from an interface class_defintion_builder.dart: - add `isInterface` and `isImplementing` with setters to ClassDefinitionBuilder for tests compilation_unit_helpers.dart: - add `tryFindImplementedClass` for tests interface_class_test.dart: - add tests for generating interface classes
…checking that similar to the sealed classes, we don't serialize `interfaces` in `library_generator` I renamed unsealedModels => serializableModels and added a rule also excluding every model that `.isInterface`
8 tasks
8 tasks done
Contributor
|
Closing as #3292 replaces it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR tries to enable the use of the
interfaceandimplementskeyword in model files.This is done in 3 steps/commits
interfaceandimplementskeywordsprotocolI described every change ordered by file in the commit descriptions.
This PR tries to close #2842.
Pre-launch Checklist
///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.If you need help, consider asking for advice on the discussion board.
Breaking changes
No breaking changes