-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create imposters from Swagger responses schemas #64
Comments
@aperezg I like this idea, and I think I could implement swagger -> various.imp.json. I would like to volunteer to contribute here 🚀. However, I have a few questions that I think we should elaborate before I start to work on this. Are the files going to have a further editing step after
|
I also noticed a couple of minor outdated links in the TOC on the readme (and, I think, within the README to other locations in the README). I can do these as part of this PR or I can raise a separate issue if preferred. |
Hello @stoovon first of all, thanks for you interest on the project :) I will try to answer your questions:
Yes, I understand that all the generations on Killgrave even that the
For now, we support
I don't understand well this point, the idea is try to generate files almost final, where we could liberate the user the tedious part of create all the
Yes I understand that define the 500 error could be a little tricky, so we can start doing as you said and we will see So, I hope have answered all your questions, and I want to see your contribution, remember use the v0.5.0 branch as base :) |
Awesome, thanks a lot for this. I know code > talk but I wanted to set a few boundaries before cutting in. I should have time to look into this on Friday evening and over the weekend. |
Implement a new Generate command to generate imposters from swagger. The command addresses many typical use cases but will need to be extended further to cover specialist use cases. Works towards friendsofgo#64.
@aperezg thanks again for the responses. Here's my first cut of the PR! I think this should address much of the above, there are going to be a couple of edge cases that this does not address but I'd be happy to resolve either in this PR or, if they're slightly out of scope as I think, I think this PR sets a good foundation to add them in future. |
Context
A lot of API that run on the world using Swagger to create a specification to document it. Is for that reason that we want to get the possibility to read the swagger files to create the imposters.
Proposed implementation
The idea is create a new flag called
swagger-gen
with the address of the swagger responses schema, we need to process those files to create all the necessary imposters on the directory that the user selected with the flagimposters
.We need create as many imposters for each endpoints as responses have, for example:
In this case we will need to create for the endpoint
/user/{userId}
with for imposters, one for200
response, another for400
and so on.We need be compatible with OpenAPI 3 Specification and Open API 2 Specification we could do that letting to the user decide wich version want to use with two differents flags to select the path,
swagger-gen
andswagger3-gen
The text was updated successfully, but these errors were encountered: