-
Notifications
You must be signed in to change notification settings - Fork 4
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
[Feature Request] Run OpenAPI / Swagger Docs #24
Comments
This package will take valid json-schema sources form any given directory and then expose them as REST endpoints, su you can query them to produce random values. Se how the server.test.js is working. |
@pateketrueke okay so to be clear, will it use the paths attribute to determine what the endpoints look like? |
It uses the filenames as endpoint paths, e.g.
|
I'm going to change this to a feature request |
Please provide your input as starting point, I'm no very familiar with OpenAPI/Swagger to accomplish this by myself. |
This is the spec for OpenAPI. It has a paths object that hold the routes. Each of these paths has a set of properties set for each response code. It fits very nicely with json-schema-faker. Here's an example of a route from the link: {
"/pets": {
"get": {
"description": "Returns all pets from the system that the user has access to",
"responses": {
"200": {
"description": "A list of pets.",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/pet"
}
}
}
}
}
}
}
}
} |
The OpenAPI uses the |
Gotcha, but I think probably there are already solutions for this. I don't want to clutter this module just to support OpenAPI, please review here to see if something fit to your needs. Otherwise it's possible to integrate, at least, the routing part from the spec but I'm not sure how complicated it'll be. So much thanks for your feedback! |
I have exported a swagger API and I'm wondering if I can use this as the README doesn't explain what this package does.
The text was updated successfully, but these errors were encountered: