Method 'GET' already declared for route '/myRoute' with constraints '{}'
See original GitHub issueHey hey! 👋🏼
I encountered this error
/platformatic/node_modules/.pnpm/find-my-way@7.3.1/node_modules/find-my-way/index.js:301
throw new Error(`Method '${method}' already declared for route '${path}' with constraints '${JSON.stringify(constraints)}'`)
^
Error: Method 'GET' already declared for route '/myRoute' with constraints '{}'
at Router._on (/platformatic/node_modules/.pnpm/find-my-way@7.3.1/node_modules/find-my-way/index.js:301:13)
at Router.on (/platformatic/node_modules/.pnpm/find-my-way@7.3.1/node_modules/find-my-way/index.js:136:10)
at Object.addNewRoute (/platformatic/node_modules/.pnpm/fastify@4.10.2/node_modules/fastify/lib/route.js:301:16)
at Object.route (/platformatic/node_modules/.pnpm/fastify@4.10.2/node_modules/fastify/lib/route.js:217:19)
at Object.prepareRoute (/platformatic/node_modules/.pnpm/fastify@4.10.2/node_modules/fastify/lib/route.js:150:18)
at Object._get [as get] (/platformatic/node_modules/.pnpm/fastify@4.10.2/node_modules/fastify/fastify.js:249:34)
at entityPlugin (/platformatic/packages/sql-openapi/lib/entity-to-routes.js:111:9)
at Plugin.exec (/platformatic/node_modules/.pnpm/avvio@8.2.0/node_modules/avvio/plugin.js:130:19)
at Boot.loadPlugin (/platformatic/node_modules/.pnpm/avvio@8.2.0/node_modules/avvio/plugin.js:272:10)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Can we add logic to create unique routes or detect duplicates (and do something with them without throwing)? 😊
Issue Analytics
- State:
- Created 9 months ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
AssertionError: Method 'GET' already declared for route #33
I came across this (still failing) test case while thinking a general solution for the issue #29 (comment) test('Similar route path, ...
Read more >Routes - Fastify
You have two ways to declare a route with Fastify: the shorthand method and the full declaration. Full declaration; Routes options; Shorthand declaration;...
Read more >How to assign routes within a base route in fastify
For the base route to work globally in all routes, you can register it in your server.js or app.js whatever you are using...
Read more >Using Reactive Routes - Quarkus
Reactive routes propose an alternative approach to implement HTTP endpoints where you declare and chain routes. This approach became very popular in the ......
Read more >Route configuration | OpenShift Container Platform 4.9
The following procedure describes how to create a simple HTTP-based route to a web application, using the hello-openshift application as an example.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this the the origin of the issue (two FK on the same entities). We should check that we use the properties keys for the nested api and not the entity names.
@rozzilla would you like to send a PR for this?