Comments (6)
Could you tell me what is the actual value of the result prior you pass it to present
?
from raisin.
The object passed to present
is a DBIx::Class::ResultSet
.
I've added a search feature to your music demo app to demonstrate this, see my fork at https://github.com/davel/Raisin
Multiple results, array returned as expected,
curl -H "Accept: text/json" http://0:5000/artists?name=Green%
{"count":1,"data":[{"hash":"20","artist":"Green Day","id":2,"albums":[{"title":"39/Smooth","id":4,"year":1990},{"title":"Kerplunk","id":5,"year":1992},{"title":"Dookie","id":6,"year":1994},{"title":"Insomniac","id":7,"year":1995},{"title":"Nimrod","id":8,"year":1997},{"title":"Warning","id":9,"year":2000},{"title":"American Idiot","id":10,"year":2004},{"title":"21st Century Breakdown","id":11,"year":2009}]}]}
No results, null
returned rather than []
,
curl -H "Accept: text/json" http://0:5000/artists?name=asdf
{"count":0,"data":null}
from raisin.
I guess that happens because DBIx::Class's search
returns undef
.
I'll take a look at it later, or if you can dump the $artists
after https://github.com/davel/Raisin/blob/master/examples/music-app/script/music_app_dbix.psgi#L38 it would also be very helpful.
from raisin.
I thought that might be the case too. However, if $artists
was undef
, the call to $artists->count
on line 41 would fail. ref($artists)
confirms that it is a DBIx::Class::ResultSet
.
from raisin.
@davel could you verify #48 fixes your issue?
from raisin.
Yes, that fixes my problem, thank you.
from raisin.
Related Issues (20)
- Optional params that fail type constraints do not return "Invalid Parameters" response.
- Encoder/Decoder are unable to cope with UTF-8 / wide characters.
- t/unit/plugin/swagger.t fails (with Type::Tiny 1.006000?) HOT 5
- Feature Request: Swagger schemes
- $count in SYNOPSIS HOT 1
- Please include VERSION in all modules HOT 4
- Authentication module in Raisin HOT 3
- Disable the route extension. HOT 2
- Ideas to discuss HOT 4
- Improvement: allow swagger to reside behind a reverse proxy
- Request for clarification HOT 3
- Reverse proxy not done correctly HOT 7
- escaping colon in resource path
- Presenting DBIx::Class::ResultSet does not work correctly HOT 6
- please tag recent CPAN releases in git HOT 1
- Regex check in Raisin::Entity flags numbers as strings for JSON::XS
- Bump version to 0.94 please? HOT 3
- route_param regex is broken by R::Routes::Endpoint::_build_regex if contains quantifiers...
- Participate in hacktoberfest?
- question: can Raisin handle file uploads ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raisin.