Git Product home page Git Product logo

Comments (14)

yakovkhalinsky avatar yakovkhalinsky commented on August 29, 2024

Hi @suleymanccelik this is currently not possible.

Currently Drakov only looks at the key of the query parameter. This is however on our roadmap.

We did a refactor of our route handling a short time ago with the view of handling these situations better in the future.

I'll do a review of what we need to do to achieve responses based on particular query parameter values and update you in this issue in the next day or so 👍

from drakov.

suleymanccelik avatar suleymanccelik commented on August 29, 2024

Thanks for reply @yakovkhalinsky . Looking forward this feature.

from drakov.

onato avatar onato commented on August 29, 2024

I would also love to see this feature.

I would like to use it for mocking an API for UI testing and creating screenshots for the App Store.

from drakov.

hendrikmaus avatar hendrikmaus commented on August 29, 2024

+1 is there any way to help?

from drakov.

yakovkhalinsky avatar yakovkhalinsky commented on August 29, 2024

The good news is, we are currently doing some work on how parameters are treated, so I would think we could do this sooner rather than later. Will keep this issue updated when we get closer to getting this feature into drakov. 👍

@hendrikmaus PR's are very welcome! Feel free to dive into the code and ask questions 👍

from drakov.

hendrikmaus avatar hendrikmaus commented on August 29, 2024

Is this supported by the official API blueprint specs?

from drakov.

yakovkhalinsky avatar yakovkhalinsky commented on August 29, 2024

@hendrikmaus previous response was wrong ( my head was in another issue :) )

I don't believe this is in the spec as far as I know.

from drakov.

groyoh avatar groyoh commented on August 29, 2024

@hendrikmaus not in the specs but handled by Apiary AFAIK.

from drakov.

hendrikmaus avatar hendrikmaus commented on August 29, 2024

Nice. This is also really neat if you write blueprints to run through dredd for testing besides your main documentation.

from drakov.

groyoh avatar groyoh commented on August 29, 2024

@yakovkhalinsky this issue should be fixed by #87. I think you can close it now.

from drakov.

IvBre avatar IvBre commented on August 29, 2024

@groyoh unfortunately the commit from #87 does not solve this issue. Drakov mock server still can't differentiate the requests with different value for the same query param, at least not using API blueprint file.
I guess until API Blueprint does not solve the issue of defining different param values for different response in one request (apiaryio/api-blueprint#58) then Drakov can't use that information in matching the requests. :(
Please let me know if I'm wrong.

from drakov.

groyoh avatar groyoh commented on August 29, 2024

@IvBre doing something like this works:

## Things [/api/query?param1=12345]

+ Parameters
    + param1 (string, `12345`) ... Parameter for the request

### Get with query parameter [GET]

+ Response 200 (application/json;charset=UTF-8)

    + Body

            {
               "id": "parameter1_12345"
            }

## Things [/api/query?param1=12346]

+ Parameters
    + param1 (string, `12346`) ... Parameter for the request

### Get with query parameter [GET]

+ Response 200 (application/json;charset=UTF-8)

    + Body

            {
               "id": "parameter1_12346"
            }

from drakov.

IvBre avatar IvBre commented on August 29, 2024

@groyoh thank you for your suggestion, it seems that it works! Although Dredd is complaining that there is no {param1} defined in the URI template, but its not critical. Thank you!

from drakov.

groyoh avatar groyoh commented on August 29, 2024

@IvBre glad I was able to help. To be clear on this, you are right when saying that this is (was?) not within the specification, but since it worked on Apiary (not sure if it is still the case) I thought than adding it to drakov would be helpful as we also needed it.

from drakov.

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.