Skip to content

Commit a1413de

Browse files
author
Mahmoud Hamdy
authored
docs: fix incorrect code examples in Reply and Request reference (#6582)
- Replace non-existent `reply.getTrailer()` with `reply.hasTrailer()` in the removeTrailer example - Fix syntax errors in schema mutation examples where an extra dot before the assignment operator made the code invalid (`schema1.properties.foo.type. = 'integer'`)
1 parent d7f01b6 commit a1413de

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

docs/Reference/Reply.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ reply.trailer('server-timing', function() {
308308
return 'db;dur=53, app;dur=47.2'
309309
})
310310
reply.removeTrailer('server-timing')
311-
reply.getTrailer('server-timing') // undefined
311+
reply.hasTrailer('server-timing') // false
312312
```
313313

314314

@@ -496,7 +496,7 @@ const schema1 = {
496496
const serialize = reply.compileSerializationSchema(schema1)
497497

498498
// Later on...
499-
schema1.properties.foo.type. = 'integer'
499+
schema1.properties.foo.type = 'integer'
500500
const newSerialize = reply.compileSerializationSchema(schema1)
501501

502502
console.log(newSerialize === serialize) // true

docs/Reference/Request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ const schema1 = {
234234
const validate = request.compileValidationSchema(schema1)
235235

236236
// Later on...
237-
schema1.properties.foo.type. = 'integer'
237+
schema1.properties.foo.type = 'integer'
238238
const newValidate = request.compileValidationSchema(schema1)
239239

240240
console.log(newValidate === validate) // true

0 commit comments

Comments
 (0)