Giter Site home page Giter Site logo

Comments (9)

raymondfeng avatar raymondfeng commented on September 28, 2024

In the explorer, you need to provide the filter value as stringified json.

Sent from my iPhone 6 Plus

On Apr 11, 2015, at 2:07 PM, mattwoolnough [email protected] wrote:

entering a simple filter in explorer 1.7.2.

[order]=ts DESC

explorer populates query as:
http://localhost:3000/api/Entry?filter=[order]=ts DESC&filter[limit]=1
instead of:
http://localhost:3000/api/Entry?filter[order]=ts DESC&filter[limit]=1

resulting in 400 error.

Also, on a more minor note explorer lists
Filter defining fields, where, orderBy, offset, and limit
instead of
Filter defining fields, where, order, offset, and limit


Reply to this email directly or view it on GitHub.

from loopback-component-explorer.

mattwoolnough avatar mattwoolnough commented on September 28, 2024

It works perfectly using the square brackets style too if you remove the unnecessary equals symbol.

from loopback-component-explorer.

bajtos avatar bajtos commented on September 28, 2024

I am afraid this is a limitation of Swagger UI that we are not going to fix.

You should compose the filter argument as JSON:

{ "order": "ts DESC", "limit": 1 }

from loopback-component-explorer.

cfjedimaster avatar cfjedimaster commented on September 28, 2024

I just ran into this myself - even if you can't fix it - is there anyway you can simply add some text to the UI to explain how to pass the value?

from loopback-component-explorer.

bajtos avatar bajtos commented on September 28, 2024

is there anyway you can simply add some text to the UI to explain how to pass the value?

I believe the UI shows the contents of description from argument's remoting metadata. Perhaps we can modify this field to include the additional help? See e.g.
https://github.com/strongloop/loopback/blob/c69e010670a4289d65e188968c54042bbf04bc28/lib/persisted-model.js#L752-L753

@cfjedimaster would you like to contribute this change yourself?

from loopback-component-explorer.

cfjedimaster avatar cfjedimaster commented on September 28, 2024

@bajtos id be happy to - but i noticed the code you linked too had this:

Filter defining fields and include

In a new LB 3 app, in explorer, I see this:

Filter defining fields, where, include, order, offset, and limit

Any idea why?

from loopback-component-explorer.

cfjedimaster avatar cfjedimaster commented on September 28, 2024

Ah - theres 3 descriptions like this, and one matches the one you linked to. I get it now. Working on a PR.

from loopback-component-explorer.

cfjedimaster avatar cfjedimaster commented on September 28, 2024

PR filed

from loopback-component-explorer.

bajtos avatar bajtos commented on September 28, 2024

Thank you, I have landed your improvement to both 2.x and master branches of LoopBack.

from loopback-component-explorer.

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.