Giter VIP home page Giter VIP logo

Comments (9)

AdamWillden avatar AdamWillden commented on August 24, 2024

I'm okay with closing this. Just a thought I'd share

from aurelia-authentication.

doktordirk avatar doktordirk commented on August 24, 2024

what why. i think it's a good idea

from aurelia-authentication.

AdamWillden avatar AdamWillden commented on August 24, 2024

Any ideas for implementation? The simplest way is just to split the string using dots.

http://stackoverflow.com/questions/6491463/accessing-nested-javascript-objects-with-string-key

http://stackoverflow.com/questions/8817394/javascript-get-deep-value-from-object-by-passing-path-to-it-as-string

Someone crazy could choose to use a dot within a property name which would screw up the pathing. However I don't think we should cater for this initially. See if it ever comes up as a requirement and if so someone could submit a PR to make an option that is non-breaking by default.

from aurelia-authentication.

doktordirk avatar doktordirk commented on August 24, 2024

i opt for dots

from aurelia-authentication.

RWOverdijk avatar RWOverdijk commented on August 24, 2024

I'm not entirely convinced about this approach. If you nest more than one level, you're doing something weird in your API. If that's the case, I'd like to hear complaints about it so they can explain what this is needed for. I'd prefer to cater for the 99%, and see why the other 1% is having problems with this.

That being said, I wouldn't refuse the PR.

from aurelia-authentication.

doktordirk avatar doktordirk commented on August 24, 2024

hmm. probably right. so basically just cut down the sample in the comments to no root and token direct child of root

from aurelia-authentication.

AdamWillden avatar AdamWillden commented on August 24, 2024

@RWOverdijk this suggestion isn't to allow more nesting (even though technically I guess it could). I'm suggesting this because having 6 options (3 for access, 3 for refresh) seems overkill, the names are confusing and the order is quirky (Prop, Prop => Name or Prop => Root => Name). I'd rather have 2 options (1 for access, 1 for refresh) and if there is any nesting then dot notation is used.

Just to be clear I believe in most cases you would be picking a property from the root, or at most 1 level deep in the response. I am in complete agreement with you. Hey, I'd be happy to have a single property and no nesting at all if you're game :-P

If we weren't to change this then I'd suggest we might consider renaming the nesting properties somehow.

from aurelia-authentication.

RWOverdijk avatar RWOverdijk commented on August 24, 2024

Dots, or a general "root" property (for all responses). I'm game yo

from aurelia-authentication.

doktordirk avatar doktordirk commented on August 24, 2024

i copied over the dot version from sattelizer. implemented here #100

from aurelia-authentication.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.