Coder Social home page Coder Social logo

Comments (2)

Faltenreich avatar Faltenreich commented on May 22, 2024 1

Hello @mirrajabi, thank you for your super-quick response!
We are currently subclassing OkHttpMockInterceptor.java to override its intercept() method - even though we have to keep track of some properties, since they are private. Adjusting the original class makes perfect sense and we will consider this recommendation as long if it meets our schedule.
You may close this issue or keep it open if there are plans to adjust the library on your own in the near future.
Have a nice day and best regards from Germany!

from okhttp-json-mock.

mirrajabi avatar mirrajabi commented on May 22, 2024

Hi,
I like the idea of the actual response being the root, but, It is not possible to achieve that with this library. I wanted it to be more general, so if in future I wanted to add another field like status it would be easier. but for your usecase, what you can do is making a clone of the project and changing the file-finding and node-finding logic of intercept function in OkHttpMockInterceptor.java to match your needs. and for status message you can put all 400 messages in a folder called 400 or something like this. also If you have a good idea to make the usage of the library more convenient to everyone, I would appreciate it because I can't think of a better solution right now.

from okhttp-json-mock.

Related Issues (7)

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.