Skip to content

Commit c3383bf

Browse files
committed
Updated doco presentation
1 parent 11e2433 commit c3383bf

File tree

2 files changed

+19
-27
lines changed

2 files changed

+19
-27
lines changed

readme.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The boolean value must be false.
5656

5757
- Applies to : `Boolean`
5858

59-
- SDL : directive @AssertFalse(message : String = "graphql.validation.AssertFalse.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
59+
- SDL : `directive @AssertFalse(message : String = "graphql.validation.AssertFalse.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION`
6060

6161
- Message : `graphql.validation.AssertFalse.message`
6262

@@ -69,7 +69,7 @@ The boolean value must be true.
6969

7070
- Applies to : `Boolean`
7171

72-
- SDL : directive @AssertTrue(message : String = "graphql.validation.AssertTrue.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
72+
- SDL : `directive @AssertTrue(message : String = "graphql.validation.AssertTrue.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION`
7373

7474
- Message : `graphql.validation.AssertTrue.message`
7575

@@ -82,7 +82,7 @@ The element must be a number whose value must be less than or equal to the speci
8282

8383
- Applies to : `String`, `Byte`, `Short`, `Int`, `Long`, `BigDecimal`, `BigInteger`, `Float`
8484

85-
- SDL : directive @DecimalMax(value : String!, inclusive : Boolean! = true, message : String = "graphql.validation.DecimalMax.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
85+
- SDL : `directive @DecimalMax(value : String!, inclusive : Boolean! = true, message : String = "graphql.validation.DecimalMax.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION`
8686

8787
- Message : `graphql.validation.DecimalMax.message`
8888

@@ -95,7 +95,7 @@ The element must be a number whose value must be greater than or equal to the sp
9595

9696
- Applies to : `String`, `Byte`, `Short`, `Int`, `Long`, `BigDecimal`, `BigInteger`, `Float`
9797

98-
- SDL : directive @DecimalMin(value : String!, inclusive : Boolean! = true, message : String = "graphql.validation.DecimalMin.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
98+
- SDL : `directive @DecimalMin(value : String!, inclusive : Boolean! = true, message : String = "graphql.validation.DecimalMin.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION`
9999

100100
- Message : `graphql.validation.DecimalMin.message`
101101

@@ -108,7 +108,7 @@ The element must be a number inside the specified `integer` and `fraction` range
108108

109109
- Applies to : `String`, `Byte`, `Short`, `Int`, `Long`, `BigDecimal`, `BigInteger`, `Float`
110110

111-
- SDL : directive @Digits(integer : Int!, fraction : Int!, message : String = "graphql.validation.Digits.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
111+
- SDL : `directive @Digits(integer : Int!, fraction : Int!, message : String = "graphql.validation.Digits.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION`
112112

113113
- Message : `graphql.validation.Digits.message`
114114

@@ -121,7 +121,7 @@ The element must be a number whose value must be less than or equal to the speci
121121

122122
- Applies to : `Byte`, `Short`, `Int`, `Long`, `BigDecimal`, `BigInteger`, `Float`
123123

124-
- SDL : directive @Max(value : Int! = 2147483647, message : String = "graphql.validation.Max.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
124+
- SDL : `directive @Max(value : Int! = 2147483647, message : String = "graphql.validation.Max.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION`
125125

126126
- Message : `graphql.validation.Max.message`
127127

@@ -134,7 +134,7 @@ The element must be a number whose value must be greater than or equal to the sp
134134

135135
- Applies to : `Byte`, `Short`, `Int`, `Long`, `BigDecimal`, `BigInteger`, `Float`
136136

137-
- SDL : directive @Min(value : Int! = 0, message : String = "graphql.validation.Min.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
137+
- SDL : `directive @Min(value : Int! = 0, message : String = "graphql.validation.Min.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION`
138138

139139
- Message : `graphql.validation.Min.message`
140140

@@ -147,7 +147,7 @@ The element must be a negative number.
147147

148148
- Applies to : `Byte`, `Short`, `Int`, `Long`, `BigDecimal`, `BigInteger`, `Float`
149149

150-
- SDL : directive @Negative(message : String = "graphql.validation.Negative.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
150+
- SDL : `directive @Negative(message : String = "graphql.validation.Negative.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION`
151151

152152
- Message : `graphql.validation.Negative.message`
153153

@@ -160,7 +160,7 @@ The element must be a negative number or zero.
160160

161161
- Applies to : `Byte`, `Short`, `Int`, `Long`, `BigDecimal`, `BigInteger`, `Float`
162162

163-
- SDL : directive @NegativeOrZero(message : String = "graphql.validation.NegativeOrZero.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
163+
- SDL : `directive @NegativeOrZero(message : String = "graphql.validation.NegativeOrZero.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION`
164164

165165
- Message : `graphql.validation.NegativeOrZero.message`
166166

@@ -173,7 +173,7 @@ The String must contain at least one non-whitespace character, according to Java
173173

174174
- Applies to : `String`
175175

176-
- SDL : directive @NotBlank(message : String = "graphql.validation.NotBlank.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
176+
- SDL : `directive @NotBlank(message : String = "graphql.validation.NotBlank.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION`
177177

178178
- Message : `graphql.validation.NotBlank.message`
179179

@@ -186,7 +186,7 @@ The element must have a non zero size.
186186

187187
- Applies to : `String`, `Lists`, `Input Objects`
188188

189-
- SDL : directive @NotEmpty(message : String = "graphql.validation.NotEmpty.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
189+
- SDL : `directive @NotEmpty(message : String = "graphql.validation.NotEmpty.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION`
190190

191191
- Message : `graphql.validation.NotEmpty.message`
192192

@@ -199,7 +199,7 @@ The String must match the specified regular expression, which follows the Java r
199199

200200
- Applies to : `String`
201201

202-
- SDL : directive @Pattern(regexp : String! =".*", message : String = "graphql.validation.Pattern.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
202+
- SDL : `directive @Pattern(regexp : String! =".*", message : String = "graphql.validation.Pattern.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION`
203203

204204
- Message : `graphql.validation.Pattern.message`
205205

@@ -212,7 +212,7 @@ The element must be a positive number.
212212

213213
- Applies to : `Byte`, `Short`, `Int`, `Long`, `BigDecimal`, `BigInteger`, `Float`
214214

215-
- SDL : directive @Positive(message : String = "graphql.validation.Positive.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
215+
- SDL : `directive @Positive(message : String = "graphql.validation.Positive.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION`
216216

217217
- Message : `graphql.validation.Positive.message`
218218

@@ -225,7 +225,7 @@ The element must be a positive number or zero.
225225

226226
- Applies to : `Byte`, `Short`, `Int`, `Long`, `BigDecimal`, `BigInteger`, `Float`
227227

228-
- SDL : directive @PositiveOrZero(message : String = "graphql.validation.PositiveOrZero.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
228+
- SDL : `directive @PositiveOrZero(message : String = "graphql.validation.PositiveOrZero.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION`
229229

230230
- Message : `graphql.validation.PositiveOrZero.message`
231231

@@ -238,7 +238,7 @@ The element range must be between the specified `min` and `max` boundaries (incl
238238

239239
- Applies to : `String`, `Byte`, `Short`, `Int`, `Long`, `BigDecimal`, `BigInteger`, `Float`
240240

241-
- SDL : directive @Range(min : Int = 0, max : Int = 2147483647, message : String = "graphql.validation.Range.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
241+
- SDL : `directive @Range(min : Int = 0, max : Int = 2147483647, message : String = "graphql.validation.Range.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION`
242242

243243
- Message : `graphql.validation.Range.message`
244244

@@ -251,6 +251,6 @@ The element size must be between the specified `min` and `max` boundaries (inclu
251251

252252
- Applies to : `String`, `Lists`, `Input Objects`
253253

254-
- SDL : directive @Size(min : Int = 0, max : Int = 2147483647, message : String = "graphql.validation.Size.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
254+
- SDL : `directive @Size(min : Int = 0, max : Int = 2147483647, message : String = "graphql.validation.Size.message") on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION`
255255

256256
- Message : `graphql.validation.Size.message`

src/test/groovy/graphql/validation/DocHelper.groovy

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@ class DocHelper {
1313
ArrayList<DirectiveConstraint> standardRules = sorted()
1414
standardRules.forEach({ it -> printConstraint(it) })
1515

16-
//standardRules.forEach({ it -> printMessage(it) })
1716
}
1817

1918

2019
private static ArrayList<DirectiveConstraint> sorted() {
21-
List<DirectiveConstraint> standardRules = new ArrayList<>(DirectiveConstraints.STANDARD_CONSTRAINTS);
22-
standardRules.sort(Comparator.comparing({ dvr -> dvr.getName() }))
20+
List<DirectiveConstraint> standardRules = new ArrayList<>(DirectiveConstraints.STANDARD_CONSTRAINTS)
21+
standardRules.sort(Comparator.comparing({ dvr -> dvr.name }))
2322
standardRules
2423
}
2524

@@ -36,7 +35,7 @@ ${r.getDocumentation().getDescription()}
3635
3736
- Applies to : ${appliesTo}
3837
39-
- SDL : ${r.getDocumentation().getDirectiveSDL()}
38+
- SDL : `${r.getDocumentation().getDirectiveSDL()}`
4039
4140
- Message : `${r.getDocumentation().getMessageTemplate()}`
4241
@@ -45,11 +44,4 @@ ${r.getDocumentation().getDescription()}
4544
}
4645

4746

48-
private static void printMessage(DirectiveConstraint r) {
49-
PrintStream out = System.out
50-
out.printf("""
51-
${r.getDocumentation().getMessageTemplate()} =
52-
""")
53-
}
54-
5547
}

0 commit comments

Comments
 (0)