Skip to content

Commit 9271fb1

Browse files
author
Christoph Bühler
committed
fix(attributes): remove unique items from array attribute since it is not allowed
This fixes #24.
1 parent ada7bb6 commit 9271fb1

File tree

5 files changed

+1
-10
lines changed

5 files changed

+1
-10
lines changed

src/KubeOps/Operator/Entities/Annotations/ItemsAttribute.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@ public class ItemsAttribute : Attribute
88
public long MinItems { get; set; } = -1;
99

1010
public long MaxItems { get; set; } = -1;
11-
12-
public bool UniqueItems { get; set; }
1311
}
1412
}

src/KubeOps/Operator/Entities/Extensions/EntityToCrdExtensions.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,6 @@ private static V1JSONSchemaProps MapProperty(PropertyInfo info)
104104
props.MinItems = items.MinItems;
105105
}
106106

107-
if (items != null)
108-
{
109-
props.UniqueItems = items.UniqueItems;
110-
}
111-
112107
// Get length description
113108
var length = info.GetCustomAttribute<LengthAttribute>();
114109
if (length != null && length.MaxLength != -1)

tests/KubeOps.Test/Operator/Entities/CrdGeneration.Test.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ public void Should_Set_Item_Information()
140140
(field.Items as V1JSONSchemaProps)?.Type?.Should().Be("string");
141141
field.MaxItems.Should().Be(42);
142142
field.MinItems.Should().Be(13);
143-
field.UniqueItems.Should().BeTrue();
144143
}
145144

146145
[Fact]

tests/KubeOps.Test/Operator/Entities/TestEntities/TestSpecEntity.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class TestSpecEntitySpec
5353
[ExternalDocs("https://google.ch", "Description")]
5454
public string ExternalDocsWithDescription { get; set; } = string.Empty;
5555

56-
[Items(MaxItems = 42, MinItems = 13, UniqueItems = true)]
56+
[Items(MaxItems = 42, MinItems = 13)]
5757
public string[] Items { get; set; } = new string[0];
5858

5959
[Length(MinLength = 2, MaxLength = 42)]

tests/KubeOps.Test/Operator/Entities/V1CustomResourceDefinitionConvert.Test.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ public void Should_Set_Item_Information()
139139
(field.Items as V1JSONSchemaProps)?.Type?.Should().Be("string");
140140
field.MaxItems.Should().Be(42);
141141
field.MinItems.Should().Be(13);
142-
field.UniqueItems.Should().BeTrue();
143142
}
144143

145144
[Fact]

0 commit comments

Comments
 (0)