Git Product home page Git Product logo

Comments (9)

karldahlgren avatar karldahlgren commented on May 30, 2024

Hi Kirill.
Unfortunately, Castle Mock currently does not base the generated responses on $ref definition. It simply generates responses based on the defined responses in the Swagger definition. It is quite simplistic and just copies the HTTP status code and uses the description as name.

I can mark this as an improvement and implement support for this, if this is something you would like to have supported?

Cheers!

from castlemock.

DeRain avatar DeRain commented on May 30, 2024

Hi, @karldahlgren. It would be great to implement support of mock responses based on the schema and $ref definition (first it can be based on examples provided in each model). Unfortunately, i almost don't know java and only can help you to test this feature. Thanks!

from castlemock.

karldahlgren avatar karldahlgren commented on May 30, 2024

Hi @DeRain.
I will look into this feature first thing tomorrow. Do you have an example Swagger file with a $ref definition that I could perhaps use?

It is I that should say thank you. Your feedback is very much appreciated. Thank you. :)

Cheers!

from castlemock.

DeRain avatar DeRain commented on May 30, 2024

Hi, @karldahlgren.
Unfortunately, i can't provide swagger file from my current project, but i see a petstore example is pretty similar and it's using $ref definitions.
http://petstore.swagger.io/
http://petstore.swagger.io/v2/swagger.json

from castlemock.

karldahlgren avatar karldahlgren commented on May 30, 2024

Thanks @DeRain.
I should have this feature ready by the end of the day. I can prepare a snapshot build for you if you want to try. :)

from castlemock.

karldahlgren avatar karldahlgren commented on May 30, 2024

Hi @DeRain.
I have implemented the feature and released a new version (1.13) of Castle Mock. It is available on the webpage: https://castlemock.com.

As mentioned earlier, all feedback is appreciated.
Feel free to comment or come with feedback.
Thanks.

from castlemock.

karldahlgren avatar karldahlgren commented on May 30, 2024

I will do one more change to improve on how enum values are generated. Will try to have that fixed as soon as possible.

from castlemock.

DeRain avatar DeRain commented on May 30, 2024

Hey @karldahlgren. Thank you for work! Sorry for late answer - we have very tight deadlines, so i couldn't find a minute to test the new version. For now - castlemock provides an error when i'm trying to load our swagger.json. I will prepare an example for you asap. Thanks!

http://take.ms/boVl2

from castlemock.

karldahlgren avatar karldahlgren commented on May 30, 2024

Hi @DeRain.
Sorry to hear that you are getting an error. If you know what could be the root cause of the problem, then I can resolve it for you. An example would be very much appreciated.

Thank you very much!

from castlemock.

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.