profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/matthyk/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Matthias Keckl matthyk Würzburg, Germany Software Engineer who loves RESTful api design and music

matthyk/rosmarin 8

Framework for REST API development

matthyk/fastify 0

Fast and low overhead web framework, for Node.js

matthyk/fastify-content-negotiation 0

Fastify plugin to enable content negotiation

matthyk/fastify-routes 0

Decorates fastify instance with a map of routes

matthyk/fastify-swagger 0

Swagger documentation generator for Fastify

matthyk/find-my-way 0

A crazy fast HTTP router

push eventmatthyk/matthyk

Matthias Keckl

commit sha 1084b61f8be993f1f096876f5ecc5c8ef124d37b

Update README.md

view details

push time in 7 hours

startedstalniy/casl

started time in 22 days

startedsupabase/supabase

started time in 25 days

push eventmatthyk/fastify

Matthias Keckl

commit sha e6e25935c85477200b9af07a40aea80f5a2c4f82

feat: throw error if schema body is not necessary (#3274)

view details

Manuel Spigolon

commit sha 1ceaa35f6cb1dbdcd44e46be138db9f0277c5504

Ajv8 by default (#3271) * upgrade to ajv8 * fix flakiness * fix tests * fix typescript * fix ajv warnings * build config validator within ajv8 * add more tests * fix tests * update docs

view details

push time in a month

PR opened fastify/fastify

fix error messages

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks.

Contributors guide: https://github.com/fastify/fastify/blob/master/CONTRIBUTING.md

By making a contribution to this project, I certify that:

  • (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

  • (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

  • (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

  • (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. -->

Fixes a bug where incorrect error messages were produced when using the path option instead of the url option for the route declaration with routemethod.

So

fastify.route({
      method: 'GET',
      path: '/test'
    })

would produce the error message: Missing handler function for GET:undefined route.

Checklist

+26 -3

0 comment

2 changed files

pr created time in a month

create barnchmatthyk/fastify

branch : fix-error-messages

created branch time in a month

Pull request review commentfastify/fastify

Payload validation

 test('Example - schemas examples', t => {     }   } -  fastify.get('/', {+  fastify.post('/', {

I've looked through the docs but haven't found a snippet anywhere that I've changed that shows up in the docs. Can you show me what I should change?

matthyk

comment created time in a month

PullRequestReviewEvent

push eventmatthyk/fastify

Axe

commit sha fb29ece8907f048c1a4378369dd6638cda0c423e

adding type for fastify.routing (#3270)

view details

Manuel Spigolon

commit sha e0957932f7adab40d0d0c2e95e94f13040ecdda2

docs: fix http status on validation (#3275)

view details

Manuel Spigolon

commit sha fd359a031a192c818fad220ad8a295aaf156cabd

docs: fix syntax (#3276)

view details

push time in a month

push eventmatthyk/fastify

matthyk

commit sha 6d6f70c197c5c8ee78ded94601a5138a48650e9d

add shorthand test cases

view details

matthyk

commit sha 1c3961ecd9c4e7cb3806c217bd749ee8bbf76509

include route in error message, fix path bug, extract validation function

view details

push time in a month

Pull request review commentfastify/fastify

Payload validation

 test('Example - schemas examples', t => {     }   } -  fastify.get('/', {+  fastify.post('/', {

Yes, I will have a look at it tomorrow!

matthyk

comment created time in a month

PullRequestReviewEvent

push eventmatthyk/fastify

matthyk

commit sha 833d1f1ed59d0219f9177348c3ef46a0a8b1f1c3

check error messages

view details

matthyk

commit sha 80d6d8191961e01af9569c6fcb6d486b048acd00

extract function

view details

push time in a month

PR opened fastify/fastify

Payload validation

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks.

Contributors guide: https://github.com/fastify/fastify/blob/master/CONTRIBUTING.md

By making a contribution to this project, I certify that:

  • (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

  • (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

  • (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

  • (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. -->

Closes #3266. An error is now thrown if a body validation schema is specified for GET or HEAD routes. The docs also explain now that the request body validation is only available for POST, PUT, PATCH, DELETE and OPTION requests. The content-type parser documentation also now provides a more detailed explanation of when the request payload is parsed and when it is not.

Checklist

+79 -9

0 comment

6 changed files

pr created time in a month

create barnchmatthyk/fastify

branch : payload-validation

created branch time in a month

push eventmatthyk/fastify

Vignesh

commit sha 88667f34007842f4edf37bbbfe6754823f499f89

fixes #2805 (#2807) * Added test case for listen method dealing with pipe * Added test case for listen method dealing with pipe * Updated test case based on coversation * Added missing prop for validationCompiler type * fixes #2805 * fixed build issue * fixed build issue * fixed build issue * Update types/schema.d.ts Co-authored-by: KaKa <climba03003@gmail.com> * Adding test case * Update types/schema.d.ts Co-authored-by: KaKa <climba03003@gmail.com> Co-authored-by: KaKa <climba03003@gmail.com>

view details

Harry Brundage

commit sha 6e95e0e94caddadbab9ea7ffc92ddbb5e10a13f4

Add me to the contributors and plugins teams (#2832)

view details

Luciano Mammino

commit sha 49571579a002de16f1dcdc0f0980d45434a19471

Fixes link preview to Reply (#2835)

view details

Ethan Neff

commit sha fc33ae97ed2de9d2c9c262f5efb966c84e942547

docs: update installation guide for typescript (#2798) fix error ``` docker/src/api on  master [?] is 📦 v1.0.0 via ⬢ v15.3.0 ❯ npx typescript --init npm ERR! could not determine executable to run npm ERR! A complete log of this run can be found in: npm ERR! /Users/ethan/.npm/_logs/2021-01-16T00_00_47_925Z-debug.log docker/src/api on  master [?] is 📦 v1.0.0 via ⬢ v15.3.0 ❯ npx tsc --init message TS6071: Successfully created a tsconfig.json file. ```

view details

makuzaverite

commit sha 91d87c54efe961496e85053bdb1bebbdffbd29ef

feature: Removing genReqId from the doc docs/Server.md (#2838)

view details

Victor Oliveira

commit sha 48cc17a778f865d95eb0e6fe3fffed64adc9aee3

Update serverless Vercel configuration (#2839)

view details

Anthony Ringoet

commit sha 300c9a43191666372be8b7a3fb57c61aea3bf211

docs: Fix encapsulation decorators example (#2840) * docs: Fix encapsulation decorators example * docs: clarify encapsulation decorators example

view details

pmjhonwang

commit sha d44fe23db07ce002f555ae82915270abcf324232

fix: reply.d.ts missing hijack function (#2843)

view details

Matteo Collina

commit sha 9c2c9b28d72dfe357128578a1472bd1e2d49f2b0

Use discord vanity URL (#2844)

view details

Frazer Smith

commit sha c2a20db4e62c77a363d958684284f4e1c6d1f30a

chore(scripts): sort alphabetically ascending order (#2845) Sorted list should allow for quicker reference when looking at scripts.

view details

Alasdair McLeay

commit sha fa28d645f746db3551799f0eb27464a9f1632c9a

Document use of JSDoc to enable Intellisense (#2846) part of #2829

view details

Manuel Spigolon

commit sha aad6772105c587af80122e9c1b2b46b7ba492730

feat: schema controller layer (#2755) * feat: introducing schema controller * moved *Compilers * rename symbol * improve api * chore: remove forEach * wip: remove clone * fix: avoid useless json clone * restored schema-compilers file * logical split components by behaviour * schema controller class * extended schema controller constructor * reduce to 1 factory function * for .. of instead forEach * fix remove monkey patch * feat: customize schema bucket * add schema controller doc * Apply suggestions from code review Co-authored-by: James Sumners <james@sumners.email> * improve docs * Update docs/Server.md Co-authored-by: James Sumners <james@sumners.email> * fix: avoid useless boolean api * add more test for the schemaController.bucket * wip setSchemaController setter * add test * fix custom schema controller per instance * fix typo Co-authored-by: James Sumners <james@sumners.email>

view details

Igor Savin

commit sha 7fdef2dcd7d08c2b908402fa6fb5ecc26b762c41

Clarify fastify-swagger description (#2850)

view details

Matteo Collina

commit sha e5ed15466f26840bc7a71f8f74da54dcce4192e2

Use forked proxy-addr instead (#2849)

view details

Matteo Collina

commit sha 65106acc184e3ecac8d649b1b46d954df96422ef

Bumped v3.12.0

view details

Rafael Gonzaga

commit sha b032424e5c4470c48e56f412dff8b8af0b728219

docs(Validation-and-Serialization): add section about coerceType array (#2851) * docs(Validation-and-Serialization): add section about coerceType array * fix: typo futher -> further * fix: adjust Fastify name * docs(Validation): remove required and add default

view details

dependabot[bot]

commit sha 0ba6c79c9f8c6e41a06a0754ab644a03b6d79267

build(deps-dev): bump form-data from 3.0.1 to 4.0.0 (#2856) Bumps [form-data](https://github.com/form-data/form-data) from 3.0.1 to 4.0.0. - [Release notes](https://github.com/form-data/form-data/releases) - [Commits](https://github.com/form-data/form-data/compare/v3.0.1...v4.0.0) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

view details

Frazer Smith

commit sha 80be71b7a6899f508fdb46080073d805876a20c9

docs(coc): bump from 1.4 to 2.0 (#2857)

view details

Alasdair McLeay

commit sha 95bb21371c6db8df8e7ee568c3f073bb33cb08e4

Update JSDoc TypeScript example (#2858)

view details

Alexander Ryzhikov

commit sha 7e848879158cd5516c9007217e828fbc1c1e349d

Add @coobaha/typed-fastify to Ecosystem.md (#2861)

view details

push time in a month

push eventmatthyk/fastify

matthyk

commit sha 1aff021286f68651c410e5d20b48b547bef89767

fix generic constraint type (#3221)

view details

Shwao

commit sha 0e45243c6c8d44375d3dedc1c704f936f67a5de1

Fix interface in route generic example (#3222)

view details

Matteo Collina

commit sha 8f75d1859ebce41c720f6504ac2194032e702d0e

Bumped v3.20.0

view details

matthyk

commit sha 44e3ffe8f1bb61a4045e22a020e6eb639f1bc402

upgrade minimum find-my-way version (#3232)

view details

Chen Junda

commit sha dfdc243b7fc857e5ba5be0728b47bc9b169c24cd

Add `serializerOpts` to server option interface (#3231) * add `serializerOpts` to server option interface * support custom props for `serializerOpts`

view details

Frazer Smith

commit sha 1299d1ef188293bc1085d14f7b488a99a2c5ae92

docs: update all nodejs doc links to point to v14.x documentation (#3227)

view details

UnButtun

commit sha 9a87b81f3375ba378aa0f34e5246a2aeaddffbf8

Added fastify-slonik plugin reference (#3226) https://github.com/Unbuttun/fastify-slonik

view details

Matteo Collina

commit sha 8371ba04d6ee8fb320ae1535233b3a999882fe3c

Bumped v3.20.1

view details

Shwao

commit sha 36bca513cbcb17f0797ef69ead4e6c7afa831b98

docs: add info about Reply generic interface (#3223) The third point in "Using Generics" says "The shorthand route methods (i.e. .get) accept a generic object `RequestGenericInterface`". But the route methods actually accept the generic object `RouteGenericInterface` which consists of `RequestGenericInterface` and `ReplyGenericInterface`. The `ReplyGenericInterface` adds the `Reply` interface to the list of interfaces.

view details

Vincent LE GOFF

commit sha c21990d5d7036273fed37eacf4b87a29ae8db6b1

doc: update status of session (#3239) * doc: update status of session * fix: review

view details

Hugo Caillard

commit sha a90c68b4cd07318610ae59a8a60c0435c9cc881c

Clarify getting started (#3241)

view details

dependabot[bot]

commit sha 612ff0beacd7c803114853dd29ec27f3c7c1178d

build(deps): bump fastify/github-action-merge-dependabot (#3243) Bumps [fastify/github-action-merge-dependabot](https://github.com/fastify/github-action-merge-dependabot) from 2.2.0 to 2.3.0. - [Release notes](https://github.com/fastify/github-action-merge-dependabot/releases) - [Commits](https://github.com/fastify/github-action-merge-dependabot/compare/v2.2.0...v2.3.0) --- updated-dependencies: - dependency-name: fastify/github-action-merge-dependabot dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

view details

Manuel Spigolon

commit sha fb5e1f176500654a97fc27f91a08288a83eb3ebe

fix: request set headers (#2817)

view details

KaKa

commit sha ebe33ccd372bb4a1f30affef52beb4f6f23fa390

docs: fix import wrong statement (#3248)

view details

VIEWVIEWVIEW

commit sha 4ade4f715d8f14941ccd3f66ca412814edcda589

Fixed dead link for @fastify/session (#3246)

view details

dependabot[bot]

commit sha 14870e6423dedbd03ebed3fbdc3d41a5765d7bbf

build(deps): bump fastify/github-action-merge-dependabot (#3249) Bumps [fastify/github-action-merge-dependabot](https://github.com/fastify/github-action-merge-dependabot) from 2.3.0 to 2.4.0. - [Release notes](https://github.com/fastify/github-action-merge-dependabot/releases) - [Commits](https://github.com/fastify/github-action-merge-dependabot/compare/v2.3.0...v2.4.0) --- updated-dependencies: - dependency-name: fastify/github-action-merge-dependabot dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

view details

Matt Bishop

commit sha 846284d57305ba93389062b3b913c1b45c4aaf2e

Add Fastify-allow plugin reference (#3242)

view details

Andrii Kostenko

commit sha 3956e684247492bff41bae30eed4355bfb0ef63d

Fixed socket leakage in TLS connection (#3254)

view details

Matteo Collina

commit sha 92e4e19af21fec3d47563ee97860bf3c6f28b74e

Bumped v3.20.2

view details

Manasseh Abiodun

commit sha e0541c7b6099c172949a10f4167d79bd10efe721

Add fastify-appwrite plugin (#3259)

view details

push time in a month

issue commentfastify/fastify

GET request payload validation error

Then we should change the documentation for DELETE and OPTION and throw an error for GET and HEAD if a schema is specified?

matthyk

comment created time in a month

issue commentfastify/fastify

GET request payload validation error

Alright, then I will throw an error if a GET route includes a schema 👍

matthyk

comment created time in a month

issue commentfastify/fastify

GET request payload validation error

I take over this work. Or should we parse the payload of GET requests just like DELETE requests so that we treat GET and DELETE requests identically?

matthyk

comment created time in a month

issue openedfastify/fastify

GET request payload validation error

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched existing issues to ensure it has not already been reported

Fastify version

3.20.1

Plugin version

No response

Node.js version

14.15

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10)

10.15.6

Description

Fastify currently parses the request payload from DELETE requests but not from GET requests even though RFC 7231 states the same for both methods.

A payload within a DELETE request message has no defined semantics; sending a payload body on a DELETE request might cause some existing implementations to reject the request.

and

A payload within a GET request message has no defined semantics; sending a payload body on a GET request might cause some existing implementations to reject the request.

I think Fastify should handle these two cases the same way. The fact that Fastify does not parse the request payload of a GET request, but at the same time allows the developer to define a validation scheme for a GET endpoint, adds to confusing errors for the developer. So Fastify tries to validate the request payload, which was not parsed before. Thus, the client always receives the error "body should be object"since its request payload was not parsed and is, therefore null and the validation can only fail.

Steps to Reproduce

const app = require('fastify')()

app.get('/', {
    schema: {
        body: {
            name: {
                type: 'string'
            }
        }
    }
}, function (req, reply) {
   // req.body === null
   reply.send('ok')
})

app.listen(8080)

Now when a client makes the following request:

GET / HTTP/1.1
Host: localhost:8080
Content-Type: application/json
Content-Length: 26

{
    "name": "testName"
}

it always receives the response:

{
    "statusCode": 400,
    "error": "Bad Request",
    "message": "body should be object"
}

Expected Behavior

Fastify should therefore either parse the payload of GET requests, give developers a warning when they specify a body validation schema, or simply skip the body validation if it is a GET request.

created time in a month

create barnchmatthyk/fastify-plugin-error

branch : main

created branch time in 2 months

created repositorymatthyk/fastify-plugin-error

created time in 2 months

PR opened fastify/fastify

upgrade minimum find-my-way version

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks.

Contributors guide: https://github.com/fastify/fastify/blob/master/CONTRIBUTING.md

By making a contribution to this project, I certify that:

  • (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

  • (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

  • (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

  • (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. -->

PR #3221 causes an error if not at least find-my-version 4.1 is installed. To prevent this, the minimum installed version should be 4.1.

Checklist

+1 -1

0 comment

1 changed file

pr created time in 2 months

push eventmatthyk/fastify

matthyk

commit sha 0ea3246435f06278291ce11691f1954163a9e5d5

upgrade minimum find-my-way version

view details

push time in 2 months

pull request commentfastify/fastify

fix generic constraint type

I think you're right. We should upgrade to find-my-way version 4.1.0.

matthyk

comment created time in 2 months

PR opened fastify/fastify

fix generic constraint type

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks.

Contributors guide: https://github.com/fastify/fastify/blob/master/CONTRIBUTING.md

By making a contribution to this project, I certify that:

  • (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

  • (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

  • (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

  • (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. -->

Since find-my-way version 4.1 it is possible to specify a generic type for the value of a constraint. The default type of this generic parameter is string. This makes it impossible to register constraints that have a value type other than string. The following example produces the error Type 'ConstraintStrategy<HTTPVersion.V1, number>' is not assignable to type 'ConstraintStrategy<HTTPVersion.V1, string>'. Type 'number' is not assignable to type 'string'..

import fastify from 'fastify'
import { ConstraintStrategy, HTTPVersion, Req, Handler} from 'find-my-way'

const constraintStrategy: ConstraintStrategy<HTTPVersion.V1, number> = {
  deriveConstraint<Context>(req: Req<HTTPVersion.V1>, ctx: Context | undefined): number {
    return 0
  },
  mustMatchWhenDerived: false,
  name: "myStrategy",
  storage() {
    return {
      get(value: number): Handler<HTTPVersion.V1> | null {
        return null
      },
      set(value: number, handler: Handler<HTTPVersion.V1>): void {},
      del(value: number): void {},
      empty(): void {}
    }
  },
  validate(value: unknown): void {
  }
}

const app = fastify({
  constraints: {
    constraintStrategy
  }
})

Setting the generic type to unknown solves this issue.

Checklist

+13 -1

0 comment

2 changed files

pr created time in 2 months

create barnchmatthyk/fastify

branch : update-constraint-type

created branch time in 2 months

push eventmatthyk/fastify

Chia Wei Ong

commit sha aa58990205ec6923358c5f86a8b0bf55a3f378f0

fix: request hanging when synchronously returning a value in setErrorHandler (#3211) * Test error handlers handling return values #3209 * setErrorHandler async/return value handling #3209

view details

qwertyforce

commit sha c3933ceb57f608a5754c5ff6cbfab3662987d970

docs: add fastify-recaptcha (#3212)

view details

Adibla

commit sha 1cfa32ecbaa86a05985bba2fa6da75d806d76972

feat: update Getting-Started.md (#3213)

view details

我可能很廢

commit sha 52afb4a1ea9f1a7b9907219135e5b087b161acdd

fix: add file option in FastifyLoggerOptions interface (#3214)

view details

matthyk

commit sha 5cf61fcbfa8b20f4b714af6d155d2740bae3d96b

Extend content type parser (#3210)

view details

push time in 2 months

create barnchmatthyk/fastify-content-negotiation

branch : main

created branch time in 2 months