Giter Site home page Giter Site logo

Comments (13)

StefH avatar StefH commented on May 21, 2024

WireMock.Net.StandAlone
There should be no need for Newtonsoft.Json; I did fix the app.config

from wiremock.net.

StefH avatar StefH commented on May 21, 2024

Static Mappings using a json file is not yet implemented. I'll build this in some time using this thread for updates.

from wiremock.net.

StefH avatar StefH commented on May 21, 2024

Support added.

See example project on how to use this.

from wiremock.net.

phillee007 avatar phillee007 commented on May 21, 2024

from wiremock.net.

StefH avatar StefH commented on May 21, 2024

Did you have time to verify this?

from wiremock.net.

StefH avatar StefH commented on May 21, 2024

@phillee007 Is it working fine?

from wiremock.net.

phillee007 avatar phillee007 commented on May 21, 2024

finally got a chance to test this!

To answer your question: yes and no...

Yes it can read mappings files that are named using a guid, however, we find it useful to actually use meaningful file names, as we're generating a whole heap of static mappings based on log files from real requests/responses from our external api. E.g. customer_get_123.json vs asdfdsafsaf234324.json

Is it possible for the static mappings reader to just read all .json files in the directory rather than forcing them to use a guid? Maybe add an optional filename property to the Mapping class so we can specify that if/when calling the admin api to add mappings at runtime too?

Thanks,
Phil

from wiremock.net.

StefH avatar StefH commented on May 21, 2024

Good point.

I will add support for all .json files and add a title to the mapping which will be used as filename if present.

from wiremock.net.

StefH avatar StefH commented on May 21, 2024

OK. I've added a "Title" as property. Can you please get the latest code and test if this works for you ?

from wiremock.net.

StefH avatar StefH commented on May 21, 2024

Were you able to test the latest code?

from wiremock.net.

phillee007 avatar phillee007 commented on May 21, 2024

Good news - I got to test this at last and it does work! Will raise another issue regarding the path matching and full urls separately

from wiremock.net.

phillee007 avatar phillee007 commented on May 21, 2024

Actually, scratch that comment re raising another issue. I see you've already added in the extra function to convert a relative url to the fully qualified url so that matcher works :-)

E.g. If the request has something like this:
...
Url": {
"Matchers": [
{
"Name": "WildcardMatcher",
"Pattern": "products/123456"
}
]
},
...

When I was using the earlier version of wiremock.net, it required me to have the fully-qualified url in the Pattern otherwise it wouldn't find the match when I requested http://myserver:9090/products/123456. E.g.

...
"Pattern": "http://myserver:9090/products/123456"
...

However, I see now that I can just specify the relative url and it works as per the regular WireMock documentation.

Great work!!! We're now ready to use this fairly heavily so will let you know if we hit any other issues

from wiremock.net.

StefH avatar StefH commented on May 21, 2024

Thanks. Please open new issues in case you encounter something.

from wiremock.net.

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.