SkywardApps / popcorn

Popcorn is a .Net Middleware for your RESTful API that allows your consumers to request exactly as much or as little as they need, with no effort from you.
https://skywardapps.github.io/popcorn/
MIT License
59 stars 19 forks source link

Debug mode - "complete" query string parameter #41

Closed alexbarbato closed 6 years ago

alexbarbato commented 6 years ago

Possible Solution

As I'm debugging/testing an implementation that uses Popcorn, I find I'm spending quite a bit more time configuring my tests to have the exact desired includes to have sufficient data to prove what I want to prove.

Maybe we consider adding a query string parameter, like say "complete", that returns all available properties in the response object and its subordinates in an API call? If abuse (or really potentially defeating the purpose of having Popcorn at all) is a concern here, maybe we make the attribute for debug mode only?

Steps to Reproduce

  1. Create a complex object that has 10+ properties, with complex sub-properties
  2. Attempt to query an endpoint that returns said object
  3. Format an includes string that basically returns everything

Expected Behavior

Ideally, testers and devs alike could have an option to brute popcorn a little, minimally in debug mode, to more easily test their endpoints so they don't have extremely long include statements in their tests. i.e. Less time testing => More time making new products

Actual Behavior

A non-trivial amount of time spent structuring API tests to have the perfect include statement to prove the logic implemented on the endpoint.

undiwahn commented 6 years ago

I kind of like the idea of a wildcard like [*] or similar.

On Tue, Oct 31, 2017 at 12:39 PM, alexbarbato notifications@github.com wrote:

Possible Solution

As I'm debugging/testing an implementation of Popcorn, I find I'm spending quite a bit more time configuring my tests to have the exact desired includes to have sufficient data to prove what I want to prove.

Maybe we consider adding a query string parameter, like say "complete", that returns all available properties in the response object and its subordinates in an API call? If abuse (or really potentially defeating the purpose of having Popcorn at all) is a concern here, maybe we make the attribute for debug mode only? Steps to Reproduce

  1. Create a complex object that has 10+ properties, with complex sub-properties
  2. Attempt to query an endpoint that returns said object
  3. Format an includes string that basically returns everything

Expected Behavior

Ideally, testers and devs alike could have an option to brute popcorn a little, minimally in debug mode, to more easily test their endpoints so they don't have extremely long include statements in their tests. i.e. Less time testing => More time making new products Actual Behavior

A non-trivial amount of time spent structuring API tests to have the perfect include statement to prove the logic implemented on the endpoint.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/SkywardApps/popcorn/issues/41, or mute the thread https://github.com/notifications/unsubscribe-auth/AJNm3qaP0QYOzMzpTfnZ92bN475_Ldx1ks5sx00qgaJpZM4QNDZ7 .

-- Nicholas MT Elliott Managing Director Skyward App Company, LLC

alexbarbato commented 6 years ago

I kind of made an assumption that we could set this debug only (but I could have just made that up completely)

If having it configurable for debug only is possible, in your vision, would you have the wildcard applied to Popcorn in both Release and Debug?

alexbarbato commented 6 years ago

@undiwahn - do you think this is one we could potentially work on?

undiwahn commented 6 years ago

Yes, go with the wildcard suggestion (should be relatively straightforward) but I don't think you need to make it debug only; this would be useful shorthand in production too

On Nov 8, 2017 9:55 AM, "Alex Barbato" notifications@github.com wrote:

@undiwahn https://github.com/undiwahn - do you think this is one we could potentially work on?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SkywardApps/popcorn/issues/41#issuecomment-342842000, or mute the thread https://github.com/notifications/unsubscribe-auth/AJNm3ktrrdJqMOYj89ZbQOAkUn5HYQczks5s0cD7gaJpZM4QNDZ7 .