products/{id} APIs conflicting with products/my-products in generated doc with OpenAPI
I did put the {id} one after the my-products one, but it doesn't seem to work?

27 Replies
hey! what package are you using for openapi?
*specifically to generate the docs view
"@scalar/hono-api-reference": "^0.5.175",
Appreciate your time responding to this!
Happy to help!
I’m afk rn, but I’ll try to repro when i get back
@MarvinKR i'm not able to repro
can you share the
describeRoute
for that /products/{id}
endpointthanks!
can you add syntax highlighting? it makes snippets much easier to read
also, what's the url in your browser when you select that route
e.g.,
http://localhost:3000/docs#tag/default/GET/users/{id}
lol. so i'm not able to repro your issue, but scalar also isn't displaying the response schemas
@MarvinKR have you tried removing the clerk
middleware (or moving it after the spec)?how do you do that? Don't you need premium discord?
Nope. Discord uses markdown syntax, so just add the language after the opening backticks: ```typescript
http://localhost:3001/api/docs#tag/products/GET/api/products/%7Bid%7D
yeah didn't work, also changing the url name didn't affect it. I feel like it's an issue with: name: "id",
in: "path",
hmmmm. this is mine:
http://localhost:3000/docs#tag/users/GET/users/{id}
Yeah I just use api in my basepath but it's pretty much the same
This is what I have in /openapi
try removing the
parameters
option
when i try to set that option and use zValidator
, the UI breaks
using only zValidator
seems to work
(import { validator as zValidator } from "hono-openapi/zod";
)/openapi
when using both
when using only params

with only
zValidator

@Aditya Mathur is it expected behavior that when using
hono-openapi/zod
, setting parameters
in describeRoute
and using zValidator
will duplicate the parameter in the spec?
This was resolved in
v0.4.5
what version are you using of hono-openapi
? @MarvinKRi'm using
v0.4.5

running the code shared above generates the preceding screenshots
Interesting, can you share a reproduction of this? And create a issue over here - https://github.com/rhinobase/hono-openapi/issues
GitHub
Issues · rhinobase/hono-openapi
A plugin for Hono to generate OpenAPI Swagger documentation - Issues · rhinobase/hono-openapi
I am working on another issue right now, which might help this one too. Not sure but I will give it a try.
Here is the PR which was merged https://github.com/rhinobase/hono-openapi/pull/64
"hono-openapi": "^0.4.5",
I need to write some tests 🙃
Haha I've never done tests either 💀
removing parameters fixed it! thx!!!!
happy to help!
@MarvinKR can you check if
v0.4.6
solves this issue for you?