Current Behavior
Originally from discord
I'm talking about the type definition, and the controller receiving a predictable variable, exactly like the example above.
Everything in Robyn happens through a request dictionary, just like flask. meaning you don't know the keys, don't know their types, and don't have autocomplete
# This is Robyn
@app.post("/jsonify/:id") # the param ID
async def json(request): # you get a "request" dictionary, without any types
print(request["params"]["id"]) # you access the param through the dict key, you don't validate the key type
return jsonify({"hello": "world"})
# This is FastAPI
@app.post("/jsonify/{id}") # the param ID
async def json(id: int): # you excplitly tell the param and it's type (auto completion and type safety)
print(id) # you already have the ID in hands, (auto complete)
return jsonify({"hello": "world"})
Desired Behavior
Screenshots / Mockups
Alternatives
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too