Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal/fwschema: Introduce NestedAttribute interface and cleanup Attribute interface methods #543

Merged
merged 4 commits into from Nov 17, 2022

Commits on Nov 16, 2022

  1. internal/fwschema: Introduce NestedAttribute interface and cleanup At…

    …tribute interface methods
    
    Reference: #132
    
    As part of upcoming effort to split schema functionality into the `datasource`, `provider`, and `resource` packages, there are some internal implementation details which need to be sorted beforehand. Throughout the 0.x versions, schema functionality has been migrated from the `tfsdk` package into the `internal/fwschema` package, but there is some lingering technical debt of duplicate and confusing methods.
    
    This change creates a new `NestedAttribute` (singular) interface which extends the `Attribute` interface with the methods only required for an attribute that does in fact implement nested attributes. The `tfsdk.Attribute` type is updated to support both the `Attribute` and `NestedAttribute` interfaces as it accurately describes the overloaded abstraction. The `NestedAttributes` (plural) interface remains to describe how `tfsdk.Attribute` implements that concepts under its `Attributes` field. The `NestedAttributes` (plural) interface and its implementations will be removed when `tfsdk.Attribute` is removed.
    
    Another aspect of these changes is cleaning up the type describing methods, removing the separate `Attribute` type `FrameworkType()` method and `NestedAttributes` type `AttributeType()` method.
    
    The upcoming split schemas will implement explicit attribute types which only implement `NestedAttribute` (singular) as appropriate.
    bflad committed Nov 16, 2022
    Copy the full SHA
    d1584e2 View commit details
    Browse the repository at this point in the history
  2. Update CHANGELOG for #543

    bflad committed Nov 16, 2022
    Copy the full SHA
    12c6810 View commit details
    Browse the repository at this point in the history

Commits on Nov 17, 2022

  1. Copy the full SHA
    a8cdb91 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    eba089e View commit details
    Browse the repository at this point in the history