MarvinKR
MarvinKR
Explore posts from servers
BABetter Auth
Created by nainglinnkhant on 2/13/2025 in #help
Can I share client API routes across subdomains?
I have a similar issue with VITE in localhost:5173 but Bun server (Hono) is in localhost:3000 ?
16 replies
DTDrizzle Team
Created by Budi on 3/6/2025 in #help
Unexpected behaviour of drizzle-zod createInsertSchema
how do you deal with numeric values? I'm not sure how to extend that so it's respected by the frontend
5 replies
HHono
Created by MarvinKR on 2/24/2025 in #help
products/{id} APIs conflicting with products/my-products in generated doc with OpenAPI
Thanks for this fix! Appreciate your time & help!
80 replies
HHono
Created by MarvinKR on 2/24/2025 in #help
products/{id} APIs conflicting with products/my-products in generated doc with OpenAPI
No description
80 replies
HHono
Created by MarvinKR on 2/24/2025 in #help
products/{id} APIs conflicting with products/my-products in generated doc with OpenAPI
yeah same here: "@hono/zod-openapi": "^0.19.2", "@hono/zod-validator": "^0.4.3", "hono": "^4.7.2", "hono-openapi": "^0.4.6", "zod": "^3.24.1", "zod-openapi": "^4.2.3"
80 replies
HHono
Created by MarvinKR on 2/24/2025 in #help
products/{id} APIs conflicting with products/my-products in generated doc with OpenAPI
type issue: Type 'ResolverResult' is not assignable to type 'ReferenceObject | SchemaObject | undefined'.ts(2322) index.d.ts(329, 9): The expected type comes from property 'schema' which is declared here on type 'MediaTypeObject'
80 replies
HHono
Created by MarvinKR on 2/24/2025 in #help
products/{id} APIs conflicting with products/my-products in generated doc with OpenAPI
80 replies
HHono
Created by MarvinKR on 2/24/2025 in #help
products/{id} APIs conflicting with products/my-products in generated doc with OpenAPI
can you do an example with a post endpoint using requestbody ?
80 replies
HHono
Created by MarvinKR on 2/24/2025 in #help
products/{id} APIs conflicting with products/my-products in generated doc with OpenAPI
But it does work in content responses:
200: {
description: "Successfully processed search",
content: {
"text/event-stream": {
schema: resolver(
z
.object({
companies: z.array(z.any()).optional(),
products: z.array(z.any()).optional(),
totalResults: z.number(),
})
.openapi({ ref: "SearchResponse" })
),
},
},
},
200: {
description: "Successfully processed search",
content: {
"text/event-stream": {
schema: resolver(
z
.object({
companies: z.array(z.any()).optional(),
products: z.array(z.any()).optional(),
totalResults: z.number(),
})
.openapi({ ref: "SearchResponse" })
),
},
},
},
80 replies
HHono
Created by MarvinKR on 2/24/2025 in #help
products/{id} APIs conflicting with products/my-products in generated doc with OpenAPI
so now I had to do this for request body:
content: {
"application/json": {
schema: {
type: "object",
required: ["query"],
properties: {
query: { type: "string" },
},
},
},
},
content: {
"application/json": {
schema: {
type: "object",
required: ["query"],
properties: {
query: { type: "string" },
},
},
},
},
80 replies
HHono
Created by MarvinKR on 2/24/2025 in #help
products/{id} APIs conflicting with products/my-products in generated doc with OpenAPI
hey @Aditya Mathur now I have this issues when writing:
requestBody: {
description: "Search query",
required: true,
content: {
"application/json": {
schema: resolver(z.object({ query: z.string() }).openapi({
ref: "SearchRequest",
})),
},
},
},
requestBody: {
description: "Search query",
required: true,
content: {
"application/json": {
schema: resolver(z.object({ query: z.string() }).openapi({
ref: "SearchRequest",
})),
},
},
},
I get this error: Type 'ResolverResult' is not assignable to type 'ReferenceObject | SchemaObject | undefined'.ts(2322) index.d.ts(329, 9): The expected type comes from property 'schema' which is declared here on type 'MediaTypeObject'
80 replies
HHono
Created by MarvinKR on 2/24/2025 in #help
products/{id} APIs conflicting with products/my-products in generated doc with OpenAPI
removing parameters fixed it! thx!!!!
80 replies
HHono
Created by MarvinKR on 2/24/2025 in #help
products/{id} APIs conflicting with products/my-products in generated doc with OpenAPI
Haha I've never done tests either 💀
80 replies
HHono
Created by MarvinKR on 2/24/2025 in #help
products/{id} APIs conflicting with products/my-products in generated doc with OpenAPI
"hono-openapi": "^0.4.5",
80 replies
HHono
Created by MarvinKR on 2/24/2025 in #help
products/{id} APIs conflicting with products/my-products in generated doc with OpenAPI
This is what I have in /openapi
"/api/products/{id}": {
"get": {
"responses": {
"200": {},
"400": {},
"401": {},
"404": {}
},
"operationId": "getApiProductsById",
"tags": [],
"description": "Fetch a specific product by ID",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"_def": {
"checks": [],
"typeName": "ZodString",
"coerce": false,
"zodOpenApi": {
"openapi": {
"ref": "ProductId"
}
}
},
"~standard": {
"version": 1,
"vendor": "zod"
}
}
},
{
"in": "param",
"name": "id",
"schema": {
"type": "string"
},
"required": true
}
]
},
"delete": {}
},
"/api/products/{id}": {
"get": {
"responses": {
"200": {},
"400": {},
"401": {},
"404": {}
},
"operationId": "getApiProductsById",
"tags": [],
"description": "Fetch a specific product by ID",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"_def": {
"checks": [],
"typeName": "ZodString",
"coerce": false,
"zodOpenApi": {
"openapi": {
"ref": "ProductId"
}
}
},
"~standard": {
"version": 1,
"vendor": "zod"
}
}
},
{
"in": "param",
"name": "id",
"schema": {
"type": "string"
},
"required": true
}
]
},
"delete": {}
},
80 replies
HHono
Created by MarvinKR on 2/24/2025 in #help
products/{id} APIs conflicting with products/my-products in generated doc with OpenAPI
Yeah I just use api in my basepath but it's pretty much the same
80 replies
HHono
Created by MarvinKR on 2/24/2025 in #help
products/{id} APIs conflicting with products/my-products in generated doc with OpenAPI
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",
80 replies
HHono
Created by MarvinKR on 2/24/2025 in #help
products/{id} APIs conflicting with products/my-products in generated doc with OpenAPI
80 replies