Skip to content

Commit 49e47d2

Browse files
committed
Remove [Required] usage on links, because all links can be turned off
1 parent cdad1ad commit 49e47d2

File tree

21 files changed

+0
-471
lines changed

21 files changed

+0
-471
lines changed

src/Examples/JsonApiDotNetCoreExample/GeneratedSwagger/JsonApiDotNetCoreExample.json

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4878,13 +4878,9 @@
48784878
"additionalProperties": false
48794879
},
48804880
"linksInErrorDocument": {
4881-
"required": [
4882-
"self"
4883-
],
48844881
"type": "object",
48854882
"properties": {
48864883
"self": {
4887-
"minLength": 1,
48884884
"type": "string"
48894885
},
48904886
"describedby": {
@@ -4894,31 +4890,21 @@
48944890
"additionalProperties": false
48954891
},
48964892
"linksInRelationship": {
4897-
"required": [
4898-
"related",
4899-
"self"
4900-
],
49014893
"type": "object",
49024894
"properties": {
49034895
"self": {
4904-
"minLength": 1,
49054896
"type": "string"
49064897
},
49074898
"related": {
4908-
"minLength": 1,
49094899
"type": "string"
49104900
}
49114901
},
49124902
"additionalProperties": false
49134903
},
49144904
"linksInResourceCollectionDocument": {
4915-
"required": [
4916-
"self"
4917-
],
49184905
"type": "object",
49194906
"properties": {
49204907
"self": {
4921-
"minLength": 1,
49224908
"type": "string"
49234909
},
49244910
"describedby": {
@@ -4940,26 +4926,18 @@
49404926
"additionalProperties": false
49414927
},
49424928
"linksInResourceData": {
4943-
"required": [
4944-
"self"
4945-
],
49464929
"type": "object",
49474930
"properties": {
49484931
"self": {
4949-
"minLength": 1,
49504932
"type": "string"
49514933
}
49524934
},
49534935
"additionalProperties": false
49544936
},
49554937
"linksInResourceDocument": {
4956-
"required": [
4957-
"self"
4958-
],
49594938
"type": "object",
49604939
"properties": {
49614940
"self": {
4962-
"minLength": 1,
49634941
"type": "string"
49644942
},
49654943
"describedby": {
@@ -4969,18 +4947,12 @@
49694947
"additionalProperties": false
49704948
},
49714949
"linksInResourceIdentifierCollectionDocument": {
4972-
"required": [
4973-
"related",
4974-
"self"
4975-
],
49764950
"type": "object",
49774951
"properties": {
49784952
"self": {
4979-
"minLength": 1,
49804953
"type": "string"
49814954
},
49824955
"related": {
4983-
"minLength": 1,
49844956
"type": "string"
49854957
},
49864958
"describedby": {
@@ -5002,18 +4974,12 @@
50024974
"additionalProperties": false
50034975
},
50044976
"linksInResourceIdentifierDocument": {
5005-
"required": [
5006-
"related",
5007-
"self"
5008-
],
50094977
"type": "object",
50104978
"properties": {
50114979
"self": {
5012-
"minLength": 1,
50134980
"type": "string"
50144981
},
50154982
"related": {
5016-
"minLength": 1,
50174983
"type": "string"
50184984
},
50194985
"describedby": {

src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Links/LinksInErrorDocument.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.ComponentModel.DataAnnotations;
21
using System.Text.Json.Serialization;
32
using JetBrains.Annotations;
43

@@ -7,7 +6,6 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.Links;
76
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
87
internal sealed class LinksInErrorDocument
98
{
10-
[Required]
119
[JsonPropertyName("self")]
1210
public string Self { get; set; } = null!;
1311

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.ComponentModel.DataAnnotations;
21
using System.Text.Json.Serialization;
32
using JetBrains.Annotations;
43

@@ -7,11 +6,9 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.Links;
76
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
87
internal sealed class LinksInRelationship
98
{
10-
[Required]
119
[JsonPropertyName("self")]
1210
public string Self { get; set; } = null!;
1311

14-
[Required]
1512
[JsonPropertyName("related")]
1613
public string Related { get; set; } = null!;
1714
}

src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Links/LinksInResourceCollectionDocument.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.ComponentModel.DataAnnotations;
21
using System.Text.Json.Serialization;
32
using JetBrains.Annotations;
43

@@ -7,7 +6,6 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.Links;
76
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
87
internal sealed class LinksInResourceCollectionDocument
98
{
10-
[Required]
119
[JsonPropertyName("self")]
1210
public string Self { get; set; } = null!;
1311

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.ComponentModel.DataAnnotations;
21
using System.Text.Json.Serialization;
32
using JetBrains.Annotations;
43

@@ -7,7 +6,6 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.Links;
76
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
87
internal sealed class LinksInResourceData
98
{
10-
[Required]
119
[JsonPropertyName("self")]
1210
public string Self { get; set; } = null!;
1311
}

src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Links/LinksInResourceDocument.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.ComponentModel.DataAnnotations;
21
using System.Text.Json.Serialization;
32
using JetBrains.Annotations;
43

@@ -7,7 +6,6 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.Links;
76
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
87
internal sealed class LinksInResourceDocument
98
{
10-
[Required]
119
[JsonPropertyName("self")]
1210
public string Self { get; set; } = null!;
1311

src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Links/LinksInResourceIdentifierCollectionDocument.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.ComponentModel.DataAnnotations;
21
using System.Text.Json.Serialization;
32
using JetBrains.Annotations;
43

@@ -7,11 +6,9 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.Links;
76
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
87
internal sealed class LinksInResourceIdentifierCollectionDocument
98
{
10-
[Required]
119
[JsonPropertyName("self")]
1210
public string Self { get; set; } = null!;
1311

14-
[Required]
1512
[JsonPropertyName("related")]
1613
public string Related { get; set; } = null!;
1714

src/JsonApiDotNetCore.OpenApi/JsonApiObjects/Links/LinksInResourceIdentifierDocument.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.ComponentModel.DataAnnotations;
21
using System.Text.Json.Serialization;
32
using JetBrains.Annotations;
43

@@ -7,11 +6,9 @@ namespace JsonApiDotNetCore.OpenApi.JsonApiObjects.Links;
76
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
87
internal sealed class LinksInResourceIdentifierDocument
98
{
10-
[Required]
119
[JsonPropertyName("self")]
1210
public string Self { get; set; } = null!;
1311

14-
[Required]
1512
[JsonPropertyName("related")]
1613
public string Related { get; set; } = null!;
1714

test/OpenApiTests/ClientIdGenerationModes/GeneratedSwagger/swagger.g.json

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -635,13 +635,9 @@
635635
"additionalProperties": false
636636
},
637637
"linksInErrorDocument": {
638-
"required": [
639-
"self"
640-
],
641638
"type": "object",
642639
"properties": {
643640
"self": {
644-
"minLength": 1,
645641
"type": "string"
646642
},
647643
"describedby": {
@@ -651,44 +647,30 @@
651647
"additionalProperties": false
652648
},
653649
"linksInRelationship": {
654-
"required": [
655-
"related",
656-
"self"
657-
],
658650
"type": "object",
659651
"properties": {
660652
"self": {
661-
"minLength": 1,
662653
"type": "string"
663654
},
664655
"related": {
665-
"minLength": 1,
666656
"type": "string"
667657
}
668658
},
669659
"additionalProperties": false
670660
},
671661
"linksInResourceData": {
672-
"required": [
673-
"self"
674-
],
675662
"type": "object",
676663
"properties": {
677664
"self": {
678-
"minLength": 1,
679665
"type": "string"
680666
}
681667
},
682668
"additionalProperties": false
683669
},
684670
"linksInResourceDocument": {
685-
"required": [
686-
"self"
687-
],
688671
"type": "object",
689672
"properties": {
690673
"self": {
691-
"minLength": 1,
692674
"type": "string"
693675
},
694676
"describedby": {

test/OpenApiTests/Headers/GeneratedSwagger/swagger.g.json

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,13 +1692,9 @@
16921692
"additionalProperties": false
16931693
},
16941694
"linksInErrorDocument": {
1695-
"required": [
1696-
"self"
1697-
],
16981695
"type": "object",
16991696
"properties": {
17001697
"self": {
1701-
"minLength": 1,
17021698
"type": "string"
17031699
},
17041700
"describedby": {
@@ -1708,31 +1704,21 @@
17081704
"additionalProperties": false
17091705
},
17101706
"linksInRelationship": {
1711-
"required": [
1712-
"related",
1713-
"self"
1714-
],
17151707
"type": "object",
17161708
"properties": {
17171709
"self": {
1718-
"minLength": 1,
17191710
"type": "string"
17201711
},
17211712
"related": {
1722-
"minLength": 1,
17231713
"type": "string"
17241714
}
17251715
},
17261716
"additionalProperties": false
17271717
},
17281718
"linksInResourceCollectionDocument": {
1729-
"required": [
1730-
"self"
1731-
],
17321719
"type": "object",
17331720
"properties": {
17341721
"self": {
1735-
"minLength": 1,
17361722
"type": "string"
17371723
},
17381724
"describedby": {
@@ -1754,26 +1740,18 @@
17541740
"additionalProperties": false
17551741
},
17561742
"linksInResourceData": {
1757-
"required": [
1758-
"self"
1759-
],
17601743
"type": "object",
17611744
"properties": {
17621745
"self": {
1763-
"minLength": 1,
17641746
"type": "string"
17651747
}
17661748
},
17671749
"additionalProperties": false
17681750
},
17691751
"linksInResourceDocument": {
1770-
"required": [
1771-
"self"
1772-
],
17731752
"type": "object",
17741753
"properties": {
17751754
"self": {
1776-
"minLength": 1,
17771755
"type": "string"
17781756
},
17791757
"describedby": {
@@ -1783,18 +1761,12 @@
17831761
"additionalProperties": false
17841762
},
17851763
"linksInResourceIdentifierCollectionDocument": {
1786-
"required": [
1787-
"related",
1788-
"self"
1789-
],
17901764
"type": "object",
17911765
"properties": {
17921766
"self": {
1793-
"minLength": 1,
17941767
"type": "string"
17951768
},
17961769
"related": {
1797-
"minLength": 1,
17981770
"type": "string"
17991771
},
18001772
"describedby": {

0 commit comments

Comments
 (0)