Skip to content

Commit d763289

Browse files
authored
all: Refactor schema validation to support type-specific logic and prevent AttributeTypes/ElementType field panics (#706)
Reference: #574 Reference: #699 Reference: #704 Reference: #705 The goal of this change is to enable easier schema validation within the framework logic. This is achieved by implementing new internal interfaces that implement shared logic across all schema types, then introduce methods on attribute types which currently implement type-specific validation logic. The new `ValidateImplementation()` methods on attribute types, while technically exported, cannot be implemented externally due to their usage of internal types. This follows the existing implementation of the framework where attribute types already cannot be extended due to the `Equal(fwschema.Attribute)` method requirement. Therefore these new `ValidateImplementation()` methods do not need to worry about compatibility promises and can be modified or removed in the future. This change also includes some breadcrumbs for other schema validation requests.
1 parent 4fc07b7 commit d763289

File tree

83 files changed

+4107
-2427
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+4107
-2427
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
kind: BUG FIXES
2+
body: 'datasource/schema: Raise errors with `ListAttribute`, `MapAttribute`, `ObjectAttribute`,
3+
and `SetAttribute` implementations instead of panics when missing required `AttributeTypes` or
4+
`ElementTypes` fields'
5+
time: 2023-03-29T10:28:50.525346-04:00
6+
custom:
7+
Issue: "699"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
kind: BUG FIXES
2+
body: 'provider/metaschema: Raise errors with `ListAttribute`, `MapAttribute`, `ObjectAttribute`,
3+
and `SetAttribute` implementations instead of panics when missing required `AttributeTypes` or
4+
`ElementTypes` fields'
5+
time: 2023-03-29T10:28:51.525346-04:00
6+
custom:
7+
Issue: "699"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
kind: BUG FIXES
2+
body: 'provider/schema: Raise errors with `ListAttribute`, `MapAttribute`, `ObjectAttribute`,
3+
and `SetAttribute` implementations instead of panics when missing required `AttributeTypes` or
4+
`ElementTypes` fields'
5+
time: 2023-03-29T10:28:52.525346-04:00
6+
custom:
7+
Issue: "699"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
kind: BUG FIXES
2+
body: 'resource/schema: Raise errors with `ListAttribute`, `MapAttribute`, `ObjectAttribute`,
3+
and `SetAttribute` implementations instead of panics when missing required `AttributeTypes` or
4+
`ElementTypes` fields'
5+
time: 2023-03-29T10:28:53.525346-04:00
6+
custom:
7+
Issue: "699"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: ENHANCEMENTS
2+
body: 'datasource/schema: Added `Schema` type `ValidateImplementation()` method, which performs framework-defined
3+
schema validation and can be used in unit testing'
4+
time: 2023-03-29T10:21:06.251285-04:00
5+
custom:
6+
Issue: "699"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: ENHANCEMENTS
2+
body: 'provider/metaschema: Added `Schema` type `ValidateImplementation()` method, which performs framework-defined
3+
schema validation and can be used in unit testing'
4+
time: 2023-03-29T10:21:07.251285-04:00
5+
custom:
6+
Issue: "699"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: ENHANCEMENTS
2+
body: 'provider/schema: Added `Schema` type `ValidateImplementation()` method, which performs framework-defined
3+
schema validation and can be used in unit testing'
4+
time: 2023-03-29T10:21:08.251285-04:00
5+
custom:
6+
Issue: "699"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: ENHANCEMENTS
2+
body: 'resource/schema: Added `Schema` type `ValidateImplementation()` method, which performs framework-defined
3+
schema validation and can be used in unit testing'
4+
time: 2023-03-29T10:21:09.251285-04:00
5+
custom:
6+
Issue: "699"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: NOTES
2+
body: 'datasource/schema: The `Schema` type `Validate()` method has been deprecated
3+
in preference of `ValidateImplementation()`'
4+
time: 2023-03-29T12:43:36.636825-04:00
5+
custom:
6+
Issue: "699"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: NOTES
2+
body: 'provider/metaschema: The `Schema` type `Validate()` method has been deprecated
3+
in preference of `ValidateImplementation()`'
4+
time: 2023-03-29T12:43:37.636825-04:00
5+
custom:
6+
Issue: "699"

0 commit comments

Comments
 (0)