question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make controller available to serialize/deserialize QPs

See original GitHub issue

I don’t know if it is possible, but it would be incredibly useful for the serialize and deserialize functions to have access to the object the query params are mixed into. For example, consider a query param that represents an array index. The deserialize function should be able to sanity check that index to make sure it’s in range.

const myQueryParams = new QueryParams({
  foo: {
    deserialize(value) {
      const length = this.get('bar.length'); // TypeError: this.get is not a function
      // ..
    }
  }
});

export default Ember.Controller.extend(myQueryParams.Mixin, {
  bar: []
});

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
potetocommented, Jul 14, 2017

this might be possible… I’ll whip something up when I wake up

0reactions
offirgolancommented, Jul 24, 2017

@mwpastore the idea behind the serialize/deserialize is not to do any business logic but only to format how it should look in the URI. The business logic should be done before setting the query parameter in the first place.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Serializing object then deserialize as list<object> C# - Stack ...
I want to serialize object and save it into a binary file, and deserialize it as list since it will returning multiple rows...
Read more >
How to serialize and deserialize JSON using C# - .NET
A common way to deserialize JSON is to first create a class with properties and fields that represent one or more of the...
Read more >
Serializing Tracking Data - Leap Motion Developers
To deserialize frame data: Create a Controller instance if one doesn't already exist. Acquire the data and, if necessary, convert it into the...
Read more >
Serialization and Deserialization in C# - Code Maze
Deserialization is the process of converting the serialized stream of data into the original object state. This ensures that the original ...
Read more >
Jackson – Decide What Fields Get Serialized/Deserialized
The simplest way to make sure a field is both serializable and deserializable is to make it public. Let's declare a simple class...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found