Comments (9)
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.
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.
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.
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.
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.
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.
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.
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!
from castlemock.
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)
- castlemock cannot auto import projects from swagger yaml files defined in dockerfile HOT 1
- Unable to import a rest project HOT 1
- `StrictHttpFirewall#setAllowedHeaderNames` should augment with existing `Predicate`
- Issues with JSON Path HOT 2
- Copy a particular Json object into the response HOT 1
- Pushing request json payload into the response body is failing
- Auto remove of the files HOT 1
- Building and running from maven without installed tomcat HOT 2
- Send multiple responses, with delays, to one request (Asynchronous Responses)
- Switching between different methods with a same type is broken
- tomcat jar file cannot find main method because of typo issue HOT 1
- Expression Validation popup can't pickup response body
- "ReferenceError: arguments is not defined" in react-bootstrap-table2-toolkit
- Is there a way to configure a response by matching a form request?
- Add back dedicated log block on the method page
- Docker - auto import projects and configuration HOT 1
- Internal Server Error when send Content-Type: application/soap+xml
- Import WSDL throws an exception
- Request Query match Get args Error 500
- Unable to upload RAML to a new rest project
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from castlemock.