You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug 🐛
The file openapi.json does not reflect endpoints correctly, it does not parse input objects correctly. When accepting a custom model as input to a post request, it is not reflected correctly to the openapi.json and the endpoint /docs/swagger.
To Reproduce 👨🔬
This is a minimal example:
import happyx
# Here are the enumstype
options_encoding*=enum
encodingA, encodingB
# here is some model modelDataProcessRequest:
data: string=""
storage: options_encoding = encodingA
xtemplate: string=""# Serve at http://127.0.0.1:5000serve"0.0.0.0", 5000:
# on GET HTTP method at http://127.0.0.1:5000/get"/":
{.gcsafe.}:
return%*{
"response": "success",
"msg": "These are not the droids, you're looking for."
}
post"/api/process[r:DataProcessRequest:json]":
{.gcsafe.}:
# Return plain text# process data herereturn%*{
"response": "success"
}
As you can see the Object is missing the enum, also it is not reflected to the frontend (see screenshot).
(Also the correct return codes are missing as this can only return a 200, but this is a minor thing in this case)
Expected behavior 🤔
I expect the two endpoints to be visible and correctly typed in the openapi.json.
Screenshots 🖼
Please complete the following information 📃
OS: Ubuntu
OS Version 22.04
HappyX version 4.6.2
HappyX project type [ssr/spa]
HappyX project language Nim
Nim version 2.0.4
HTTP Server Default
The text was updated successfully, but these errors were encountered:
Describe the bug 🐛
The file
openapi.json
does not reflect endpoints correctly, it does not parse input objects correctly. When accepting a custom model as input to a post request, it is not reflected correctly to theopenapi.json
and the endpoint/docs/swagger
.To Reproduce 👨🔬
This is a minimal example:
The OpenAPI results in this:
As you can see the Object is missing the enum, also it is not reflected to the frontend (see screenshot).
(Also the correct return codes are missing as this can only return a 200, but this is a minor thing in this case)
Expected behavior 🤔
I expect the two endpoints to be visible and correctly typed in the
openapi.json
.Screenshots 🖼
Please complete the following information 📃
The text was updated successfully, but these errors were encountered: