francescovallone / serinus

Serinus is a minimalistic framework for building efficient and scalable backend applications powered by Dart. 🎯
https://serinus.app
MIT License
41 stars 3 forks source link

question: Parameter parsing #81

Closed mjablecnik closed 2 months ago

mjablecnik commented 2 months ago

Hello, I compare serinus with shelf and I have this question: Does Serinus support parsing parameter from path similar as shelf_router:

app.get('/user/<user>', (Request request, String user) {
  return Response.ok('hello $user');
});

Where you can have user variable added into method.

In Serinus documentation I see that I have to write context.params['name'] for access to params:

on(Route.get('/<id>/<name>'), (context) async {
      return 'Hello ${context.params['name']} with id ${context.params['id']}!';
    });

And also parsing object from body of POST would be fine to support:

For example when I send this json in body:

{
  "name": "John",
  "surname": "Doe",
  "email": "john.doe@gmail.com",
  "phone": "+420 467 738 275",
  "is_verified": true,
  "age": 27,
}

It would be good to automatically parse into User class.

francescovallone commented 2 months ago

Hello, I will go by points:

mjablecnik commented 2 months ago

Ok, so I will wait then you release version 1.0.0 Do you have some expectation when it could be? :)

francescovallone commented 2 months ago

I would like to fully release it at the end of october probably. But after some of the biggest changes I will release some pre-release versions 😃

mjablecnik commented 2 months ago

Ok, when you will have ready 1.0.0 in beta stage, I will try it and test it. I would like to use Serinus in some my future projects but I want to work with stable well tested version. :)

francescovallone commented 2 months ago

I will close this issue for now. But feel free to reopen it. 😁